instruction
stringlengths 151
7.46k
| output
stringlengths 2
4.44k
| source
stringclasses 26
values |
---|---|---|
CREATE TABLE table_name_9 (
club VARCHAR,
drawn VARCHAR,
try_bonus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Club, when Drawn is '0', and when Try Bonus is '5'?
| SELECT club FROM table_name_9 WHERE drawn = "0" AND try_bonus = "5" | sql_create_context |
CREATE TABLE table_name_52 (
champion VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the champion for christopher miles runner-up
| SELECT champion FROM table_name_52 WHERE runner_up = "christopher miles" | sql_create_context |
CREATE TABLE table_22848 (
"Rank" real,
"London Borough" text,
"Indian Population" real,
"Pakistani Population" real,
"Bangladeshi Population" real,
"Chinese Population" real,
"Other Asian Population" real,
"Total Asian Population" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Chinese population in the borough with 26347 Pakistanis?
| SELECT "Chinese Population" FROM table_22848 WHERE "Pakistani Population" = '26347' | wikisql |
CREATE TABLE table_name_74 (
team_1 VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team one for preliminary final
| SELECT team_1 FROM table_name_74 WHERE name = "preliminary final" | sql_create_context |
CREATE TABLE table_14990 (
"LT Nos" text,
"Year" real,
"Bldr" text,
"Type" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Bldr of mcw&f, and a Year smaller than 1927, and a LT Nos of 9820-9821 has what type?
| SELECT "Type" FROM table_14990 WHERE "Bldr" = 'mcw&f' AND "Year" < '1927' AND "LT Nos" = '9820-9821' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many patients whose days of hospital stay is greater than 17 and drug name is sulfameth/trimethoprim ds?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "17" AND prescriptions.drug = "Sulfameth/Trimethoprim DS" | mimicsql_data |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and manager_id , and visualize them by a bar chart, display in desc by the LAST_NAME please.
| SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC | nvbench |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
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
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
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 VoteTypes (
Id number,
Name text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
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 CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Users with 'stackoverflow is evil' in their profile.
| SELECT DisplayName, AboutMe FROM Users WHERE AboutMe LIKE '%evil%' | sede |
CREATE TABLE table_name_1 (
circuit VARCHAR,
fastest_lap VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the circuit when Phil Hill has the fastest lap?
| SELECT circuit FROM table_name_1 WHERE fastest_lap = "phil hill" | sql_create_context |
CREATE TABLE table_name_35 (
high_rebounds VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the highest rebounds of the game with A. Johnson (6) as the highest assist?
| SELECT high_rebounds FROM table_name_35 WHERE high_assists = "a. johnson (6)" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
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
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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 microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the five most commonly ordered lab tests for patients who received thrombolytics before within the same hospital visit until 2102?
| SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'thrombolytics' AND STRFTIME('%y', treatment.treatmenttime) <= '2102') AS t1 JOIN (SELECT patient.uniquepid, lab.labname, lab.labresulttime, patient.patienthealthsystemstayid FROM lab JOIN patient ON lab.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', lab.labresulttime) <= '2102') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.labresulttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.labname) AS t3 WHERE t3.c1 <= 5 | eicu |
CREATE TABLE table_train_129 (
"id" int,
"cerebral_neoplasia" bool,
"gender" string,
"mini_mental_state_examination_mmse" int,
"multiple_lacunar_infarcts" bool,
"neurodegenerative_disease" bool,
"mri_abnormality" bool,
"nervous_system_functioning" bool,
"head_injury" bool,
"serious_neurological_disorders" bool,
"huntington_disease" bool,
"space_occupying_lesions" bool,
"major_cortical_stroke" bool,
"fronto_temporal_dementia" bool,
"encephalomalacia" bool,
"vascular_malformations" bool,
"systemic_medical_diseases" bool,
"single_prior_infarct" bool,
"subdural_hematoma" bool,
"single_prior_hemorrhage" bool,
"abscess" bool,
"disturbance_of_consciousness" bool,
"seizure_disorder" bool,
"tumor" bool,
"parkinson_disease" bool,
"cerebral_contusion" bool,
"body_mass_index_bmi" float,
"lewy_body_dementia" bool,
"aneurysm" bool,
"ad" bool,
"infarct" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the patient has evidence of any clinically significant neurodegenerative disease, or other serious neurological disorders other than ad including but not limited to lewy body dementia, fronto _ temporal dementia, parkinson's disease, huntington's disease, major cortical stroke, major head trauma, primary or secondary cerebral neoplasia or systemic medical diseases that are, in the investigator's opinion, likely to affect central nervous system functioning and may influence the outcome or analysis of the scan results.
| SELECT * FROM table_train_129 WHERE neurodegenerative_disease = 1 OR serious_neurological_disorders = 1 AND ad = 0 OR lewy_body_dementia = 1 OR fronto_temporal_dementia = 1 OR parkinson_disease = 1 OR huntington_disease = 1 OR major_cortical_stroke = 1 OR head_injury = 1 OR cerebral_neoplasia = 1 OR systemic_medical_diseases = 1 OR nervous_system_functioning = 1 | criteria2sql |
CREATE TABLE table_name_17 (
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the retired time on someone who had 43 laps on a grip of 18?
| SELECT time_retired FROM table_name_17 WHERE laps = 43 AND grid = 18 | sql_create_context |
CREATE TABLE table_43600 (
"Name" text,
"Hanzi" text,
"Hanyu Pinyin" text,
"Population (2004 est.)" text,
"Area (km\u00b2)" text,
"Density (/km\u00b2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Hanyu Pinyin is labeled rural?
| SELECT "Hanyu Pinyin" FROM table_43600 WHERE "Name" = 'rural' | 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),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For those employees who was hired before 2002-06-21, show me about the distribution of job_id and the sum of employee_id , and group by attribute job_id in a bar chart, and I want to order JOB_ID in asc order.
| SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_203_400 (
id number,
"district" text,
"vacator" text,
"reason for change" text,
"successor" text,
"date successor\nseated" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which district is listed last on this chart ?
| SELECT "district" FROM table_203_400 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_2114308_1 (
broadcast_date VARCHAR,
viewers__in_millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the broadcast date of 6.9 million viewers
| SELECT broadcast_date FROM table_2114308_1 WHERE viewers__in_millions_ = "6.9" | sql_create_context |
CREATE TABLE table_name_82 (
feminine_ōn_stems VARCHAR,
feminine_ō_stems VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ending does siangu get for n?
| SELECT feminine_ōn_stems FROM table_name_82 WHERE feminine_ō_stems = "siangu" | sql_create_context |
CREATE TABLE table_30672 (
"Couple" text,
"Style" text,
"Music" text,
"Trine Dehli Cleve" real,
"Tor Fl\u00f8ysvik" real,
"Karianne Gulliksen" real,
"Christer Tornell" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total score received by the couple that danced to ' ymca ' village people?
| SELECT MAX("Total") FROM table_30672 WHERE "Music" = ' YMCA "— Village People' | wikisql |
CREATE TABLE table_204_463 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long after 2008 did it take for division 4 to qualify for the playoffs once again ?
| SELECT "year" - 2008 FROM table_204_463 WHERE "playoffs" <> 'did not qualify' AND "year" > 2008 | squall |
CREATE TABLE table_name_7 (
runners_up VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the runners-up for the FC Viktoria Plze club?
| SELECT runners_up FROM table_name_7 WHERE club = "fc viktoria plzeň" | sql_create_context |
CREATE TABLE table_64901 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" real,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the average league goals that have 2 (1) as the total apps?
| SELECT AVG("League Goals") FROM table_64901 WHERE "Total Apps" = '2 (1)' | wikisql |
CREATE TABLE table_69431 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 9:30 feature with la porte des toiles at 8:30?
| SELECT "9:30" FROM table_69431 WHERE "8:30" = 'la porte des étoiles' | wikisql |
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
)
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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many patients were tested for triiodothyronine (t3)?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Triiodothyronine (T3)" | mimicsql_data |
CREATE TABLE table_name_34 (
killed INTEGER,
perpetrator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many kills did basobas, florentino have?
| SELECT MAX(killed) FROM table_name_34 WHERE perpetrator = "basobas, florentino" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- had patient 012-26564 in their last hospital visit been diagnosed with tricyclic overdose - with respiratory depression?
| SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-26564' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND diagnosis.diagnosisname = 'tricyclic overdose - with respiratory depression' | eicu |
CREATE TABLE table_66780 (
"Outcome" text,
"Date" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent for the winner outcome on a hard surface on August 27, 2011?
| SELECT "Opponent" FROM table_66780 WHERE "Outcome" = 'winner' AND "Surface" = 'hard' AND "Date" = 'august 27, 2011' | wikisql |
CREATE TABLE table_47932 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day was the surface clay and the score 6 1, 6 4?
| SELECT "Date" FROM table_47932 WHERE "Surface" = 'clay' AND "Score" = '6–1, 6–4' | wikisql |
CREATE TABLE table_75486 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Bronze is the highest one that has a Rank larger than 1, and a Nation of dominican republic, and a Total larger than 4?
| SELECT MAX("Bronze") FROM table_75486 WHERE "Rank" > '1' AND "Nation" = 'dominican republic' AND "Total" > '4' | wikisql |
CREATE TABLE table_76425 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record on July 12?
| SELECT "Record" FROM table_76425 WHERE "Date" = 'july 12' | wikisql |
CREATE TABLE table (
r VARCHAR,
coppa_italia INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of r for coppa italia larger than 1.0
| SELECT COUNT(r) FROM table WHERE coppa_italia > 1.0 | sql_create_context |
CREATE TABLE table_11970261_2 (
interview VARCHAR,
swimsuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the interview with swimsuit being 9.140
| SELECT interview FROM table_11970261_2 WHERE swimsuit = "9.140" | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM text,
CYBQMC text,
CYCWH text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text,
MZBMLX number,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM text,
RYSJ time,
CYSJ time,
CYZTDM number
)
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,
ZZYSGH text,
QTJZYSGH text,
JZZDBM text,
JZZDSM text,
MZZYZDZZBM text,
MZZYZDZZMC text,
SG number,
TZ number,
TW number,
SSY number,
SZY number,
XL number,
HXPLC number,
ML number,
JLSJ time
)
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,
YQMC text,
CKZFWDX text,
CKZFWXX number,
CKZFWSX number,
JLDW text
)
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 text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
JYKSBM text,
JYKSMC text,
BGJGDM text,
BGJGMC text,
SQRQ time,
CJRQ time,
JYRQ time,
BGSJ time,
BBDM text,
BBMC text,
JYBBH text,
BBZT number,
BBCJBW text,
JSBBSJ time,
JYXMMC text,
JYXMDM text,
JYSQJGMC text,
JYJGMC text,
JSBBRQSJ time,
JYJSQM text,
JYJSGH text
)
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 住院就医编号为92564825799的住院期间的主要诊断编码类型、编码列表、名称列表是啥呢?
| SELECT ZYBMLX, ZYZDBM, ZYZDMC FROM zyjzjlb WHERE JZLSH = '92564825799' | css |
CREATE TABLE table_24066 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is he archive for the episode with a run time of 24:05?
| SELECT "Archive" FROM table_24066 WHERE "Run time" = '24:05' | wikisql |
CREATE TABLE table_name_25 (
record VARCHAR,
opponent VARCHAR,
points VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the record for a game past 44 against the Dallas Stars with more than 54 points?
| SELECT record FROM table_name_25 WHERE points > 54 AND game > 44 AND opponent = "dallas stars" | sql_create_context |
CREATE TABLE table_31458 (
"Station" text,
"Metlink code" text,
"Line(s)" text,
"Service(s)" text,
"Serves" text,
"km from Wellington" text,
"Fare zone(s)" text,
"Opened" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the metlink code that opened in 1908?
| SELECT "Metlink code" FROM table_31458 WHERE "Opened" = '1908' | wikisql |
CREATE TABLE table_18283 (
"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 Robert W. Edgar belong?
| SELECT "Party" FROM table_18283 WHERE "Incumbent" = 'Robert W. Edgar' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE 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,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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,
value number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the top five most common diagnosis for which patients were diagnosed during the same month after being diagnosed until 2103 with tracheostomy status?
| SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'tracheostomy status') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2103') AS t1 JOIN (SELECT admissions.subject_id, diagnoses_icd.icd9_code, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', diagnoses_icd.charttime) <= '2103') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 5) | mimic_iii |
CREATE TABLE table_20963 (
"Wicket" text,
"Runs" real,
"Batting partners" text,
"Batting team" text,
"Fielding team" text,
"Venue" text,
"Season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the batting partners for the 1997 season?
| SELECT "Batting partners" FROM table_20963 WHERE "Season" = '1997' | wikisql |
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,
INSU_TYPE text,
IN_DIAG_DIS_CD text,
IN_DIAG_DIS_NM text,
IN_HOSP_DATE time,
IN_HOSP_DAYS number,
MAIN_COND_DES text,
MED_AMOUT number,
MED_CLINIC_ID text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
MED_SER_ORG_NO text,
MED_TYPE number,
OUT_DIAG_DIS_CD text,
OUT_DIAG_DIS_NM text,
OUT_DIAG_DOC_CD text,
OUT_DIAG_DOC_NM text,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
PERSON_AGE number,
PERSON_ID text,
PERSON_NM text,
PERSON_SEX number,
REIMBURSEMENT_FLG number,
REMOTE_SETTLE_FLG text,
SERVANT_FLG text,
SOC_SRT_CARD text,
SYNC_TIME time,
TRADE_TYPE number
)
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,
FLX_MED_ORG_ID text,
ILL_PAY number,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
LAS_OVE_PAY number,
MED_AMOUT number,
MED_CLINIC_ID text,
MED_SAFE_PAY_ID text,
MED_TYPE number,
OLDC_FUND_PAY number,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_ADD_PAY number,
OVE_PAY number,
PERSON_ID text,
PER_ACC_PAY number,
PER_EXP number,
PER_SOL number,
RECEIVER_DEAL_ID text,
RECEIVER_OFFSET_ID text,
RECEIVER_REVOKE_ID text,
RECIPE_BILL_ID text,
REF_SLT_FLG number,
REIMBURS_FLG number,
SENDER_DEAL_ID text,
SENDER_OFFSET_ID text,
SENDER_REVOKE_ID text,
SPE_FUND_PAY number,
SUP_ADD_PAY number,
SYNC_TIME time,
TRADE_TYPE number
)
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,
MED_EXP_BILL_ID text,
MED_EXP_DET_ID text,
MED_INV_ITEM_TYPE text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_SELF_AMO number,
PRESCRIPTION_CODE text,
PRESCRIPTION_ID text,
QTY number,
RECIPE_BILL_ID text,
REF_STA_FLG number,
REIMBURS_TYPE number,
REMOTE_SETTLE_FLG text,
RER_SOL number,
SELF_PAY_AMO number,
SELF_PAY_PRO number,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
SPEC text,
STA_DATE time,
STA_FLG number,
SYNC_TIME time,
TRADE_TYPE number,
UNIVALENT number,
UP_LIMIT_AMO number,
USE_FRE text,
VAL_UNIT text
)
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 在0560668这个医院的患者97484967的就诊记录中有哪些就诊科室名称包含了急诊
| SELECT * FROM t_kc21 WHERE t_kc21.PERSON_ID = '97484967' AND t_kc21.MED_SER_ORG_NO = '0560668' AND t_kc21.MED_ORG_DEPT_NM LIKE '%急诊%' | css |
CREATE TABLE table_name_29 (
visitor VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the visitor in the game that had Ottawa as the home team?
| SELECT visitor FROM table_name_29 WHERE home = "ottawa" | sql_create_context |
CREATE TABLE table_5103 (
"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.
-- How many Played have a Lost smaller than 3, and a Difference of 6, and Points larger than 6?
| SELECT COUNT("Played") FROM table_5103 WHERE "Lost" < '3' AND "Difference" = '6' AND "Points" > '6' | wikisql |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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 text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_ZYJZJLB text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC 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,
ZYLBDM text,
ZYMC text
)
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 text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
YLJGDM text,
ZSEBZ number,
ZZBZ number,
ZZYSGH text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 在医院6798205的科室名中有手外科几个字的就诊科室的门诊中,有哪些是患者96787952的就诊记录流水号
| SELECT mzjzjlb.JZLSH 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.RYBH = '96787952' AND hz_info.YLJGDM = '6798205' AND mzjzjlb.JZKSMC LIKE '%手外科%' | css |
CREATE TABLE table_58748 (
"South West DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many byes did they have against smaller than 1544, 13 wins, and draws larger than 0?
| SELECT COUNT("Byes") FROM table_58748 WHERE "Against" < '1544' AND "Wins" = '13' AND "Draws" > '0' | wikisql |
CREATE TABLE table_68896 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the Points classification for Stage 13?
| SELECT "Points classification" FROM table_68896 WHERE "Stage" = '13' | wikisql |
CREATE TABLE table_73902 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many categories fall under the category of britons?
| SELECT COUNT("Type") FROM table_73902 WHERE "Nickname" = 'Britons' | wikisql |
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 tables provided above.
-- For those records from the products and each product's manufacturer, show me about the distribution of name and the amount of name , and group by attribute name in a bar chart, rank in ascending by the Y-axis.
| SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name) | nvbench |
CREATE TABLE table_203_764 (
id number,
"name" text,
"date" number,
"nation" text,
"displacement" text,
"speed" text,
"number" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many tons of displacement does type b have ?
| SELECT "displacement" FROM table_203_764 WHERE "name" = 'type b' | squall |
CREATE TABLE table_34980 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For an ICAO of VCCT, what is the IATA?
| SELECT "IATA" FROM table_34980 WHERE "ICAO" = 'vcct' | wikisql |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Compute the total the total number across type as a pie chart.
| SELECT Type, COUNT(*) FROM ship GROUP BY Type | 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
)
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,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many patients born before the year 1821 had an urgent admission type?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "1821" | mimicsql_data |
CREATE TABLE table_name_85 (
writer VARCHAR,
producer_executive_producer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which writer had a producer DKA, JL, AS?
| SELECT writer FROM table_name_85 WHERE producer_executive_producer = "dka, jl, as" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, show by the bars in descending.
| SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_name_37 (
score VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the tournament with younes el aynaoui as the opponent?
| SELECT score FROM table_name_37 WHERE opponent = "younes el aynaoui" | sql_create_context |
CREATE TABLE table_80148 (
"Designation" text,
"Constellation" text,
"Date sent" text,
"Arrival date" text,
"Message" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is Hip 4872?
| SELECT "Constellation" FROM table_80148 WHERE "Designation" = 'hip 4872' | wikisql |
CREATE TABLE hall_of_fame (
player_id TEXT,
yearid INTEGER,
votedby TEXT,
ballots NUMERIC,
needed NUMERIC,
votes NUMERIC,
inducted TEXT,
category TEXT,
needed_note TEXT
)
CREATE TABLE manager_award_vote (
award_id TEXT,
year INTEGER,
league_id TEXT,
player_id TEXT,
points_won INTEGER,
points_max INTEGER,
votes_first INTEGER
)
CREATE TABLE college (
college_id TEXT,
name_full TEXT,
city TEXT,
state TEXT,
country TEXT
)
CREATE TABLE pitching_postseason (
player_id TEXT,
year INTEGER,
round TEXT,
team_id TEXT,
league_id TEXT,
w INTEGER,
l INTEGER,
g INTEGER,
gs INTEGER,
cg INTEGER,
sho INTEGER,
sv INTEGER,
ipouts INTEGER,
h INTEGER,
er INTEGER,
hr INTEGER,
bb INTEGER,
so INTEGER,
baopp TEXT,
era NUMERIC,
ibb NUMERIC,
wp NUMERIC,
hbp NUMERIC,
bk NUMERIC,
bfp NUMERIC,
gf INTEGER,
r INTEGER,
sh NUMERIC,
sf NUMERIC,
g_idp NUMERIC
)
CREATE TABLE postseason (
year INTEGER,
round TEXT,
team_id_winner TEXT,
league_id_winner TEXT,
team_id_loser TEXT,
league_id_loser TEXT,
wins INTEGER,
losses INTEGER,
ties INTEGER
)
CREATE TABLE park (
park_id TEXT,
park_name TEXT,
park_alias TEXT,
city TEXT,
state TEXT,
country TEXT
)
CREATE TABLE team_franchise (
franchise_id TEXT,
franchise_name TEXT,
active TEXT,
na_assoc TEXT
)
CREATE TABLE pitching (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
league_id TEXT,
w INTEGER,
l INTEGER,
g INTEGER,
gs INTEGER,
cg INTEGER,
sho INTEGER,
sv INTEGER,
ipouts NUMERIC,
h INTEGER,
er INTEGER,
hr INTEGER,
bb INTEGER,
so INTEGER,
baopp NUMERIC,
era NUMERIC,
ibb NUMERIC,
wp NUMERIC,
hbp NUMERIC,
bk INTEGER,
bfp NUMERIC,
gf NUMERIC,
r INTEGER,
sh NUMERIC,
sf NUMERIC,
g_idp NUMERIC
)
CREATE TABLE appearances (
year INTEGER,
team_id TEXT,
league_id TEXT,
player_id TEXT,
g_all NUMERIC,
gs NUMERIC,
g_batting INTEGER,
g_defense NUMERIC,
g_p INTEGER,
g_c INTEGER,
g_1b INTEGER,
g_2b INTEGER,
g_3b INTEGER,
g_ss INTEGER,
g_lf INTEGER,
g_cf INTEGER,
g_rf INTEGER,
g_of INTEGER,
g_dh NUMERIC,
g_ph NUMERIC,
g_pr NUMERIC
)
CREATE TABLE team_half (
year INTEGER,
league_id TEXT,
team_id TEXT,
half INTEGER,
div_id TEXT,
div_win TEXT,
rank INTEGER,
g INTEGER,
w INTEGER,
l INTEGER
)
CREATE TABLE manager (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
inseason INTEGER,
g INTEGER,
w INTEGER,
l INTEGER,
rank NUMERIC,
plyr_mgr TEXT
)
CREATE TABLE manager_half (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
inseason INTEGER,
half INTEGER,
g INTEGER,
w INTEGER,
l INTEGER,
rank INTEGER
)
CREATE TABLE fielding_outfield (
player_id TEXT,
year INTEGER,
stint INTEGER,
glf NUMERIC,
gcf NUMERIC,
grf NUMERIC
)
CREATE TABLE manager_award (
player_id TEXT,
award_id TEXT,
year INTEGER,
league_id TEXT,
tie TEXT,
notes NUMERIC
)
CREATE TABLE salary (
year INTEGER,
team_id TEXT,
league_id TEXT,
player_id TEXT,
salary INTEGER
)
CREATE TABLE team (
year INTEGER,
league_id TEXT,
team_id TEXT,
franchise_id TEXT,
div_id TEXT,
rank INTEGER,
g INTEGER,
ghome NUMERIC,
w INTEGER,
l INTEGER,
div_win TEXT,
wc_win TEXT,
lg_win TEXT,
ws_win TEXT,
r INTEGER,
ab INTEGER,
h INTEGER,
double INTEGER,
triple INTEGER,
hr INTEGER,
bb INTEGER,
so NUMERIC,
sb NUMERIC,
cs NUMERIC,
hbp NUMERIC,
sf NUMERIC,
ra INTEGER,
er INTEGER,
era NUMERIC,
cg INTEGER,
sho INTEGER,
sv INTEGER,
ipouts INTEGER,
ha INTEGER,
hra INTEGER,
bba INTEGER,
soa INTEGER,
e INTEGER,
dp NUMERIC,
fp NUMERIC,
name TEXT,
park TEXT,
attendance NUMERIC,
bpf INTEGER,
ppf INTEGER,
team_id_br TEXT,
team_id_lahman45 TEXT,
team_id_retro TEXT
)
CREATE TABLE player_award (
player_id TEXT,
award_id TEXT,
year INTEGER,
league_id TEXT,
tie TEXT,
notes TEXT
)
CREATE TABLE batting (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
league_id TEXT,
g INTEGER,
ab NUMERIC,
r NUMERIC,
h NUMERIC,
double NUMERIC,
triple NUMERIC,
hr NUMERIC,
rbi NUMERIC,
sb NUMERIC,
cs NUMERIC,
bb NUMERIC,
so NUMERIC,
ibb NUMERIC,
hbp NUMERIC,
sh NUMERIC,
sf NUMERIC,
g_idp NUMERIC
)
CREATE TABLE player_college (
player_id TEXT,
college_id TEXT,
year INTEGER
)
CREATE TABLE batting_postseason (
year INTEGER,
round TEXT,
player_id TEXT,
team_id TEXT,
league_id TEXT,
g INTEGER,
ab INTEGER,
r INTEGER,
h INTEGER,
double INTEGER,
triple INTEGER,
hr INTEGER,
rbi INTEGER,
sb INTEGER,
cs NUMERIC,
bb INTEGER,
so INTEGER,
ibb NUMERIC,
hbp NUMERIC,
sh NUMERIC,
sf NUMERIC,
g_idp NUMERIC
)
CREATE TABLE player (
player_id TEXT,
birth_year NUMERIC,
birth_month NUMERIC,
birth_day NUMERIC,
birth_country TEXT,
birth_state TEXT,
birth_city TEXT,
death_year NUMERIC,
death_month NUMERIC,
death_day NUMERIC,
death_country TEXT,
death_state TEXT,
death_city TEXT,
name_first TEXT,
name_last TEXT,
name_given TEXT,
weight NUMERIC,
height NUMERIC,
bats TEXT,
throws TEXT,
debut TEXT,
final_game TEXT,
retro_id TEXT,
bbref_id TEXT
)
CREATE TABLE player_award_vote (
award_id TEXT,
year INTEGER,
league_id TEXT,
player_id TEXT,
points_won NUMERIC,
points_max INTEGER,
votes_first NUMERIC
)
CREATE TABLE home_game (
year INTEGER,
league_id TEXT,
team_id TEXT,
park_id TEXT,
span_first TEXT,
span_last TEXT,
games INTEGER,
openings INTEGER,
attendance INTEGER
)
CREATE TABLE fielding_postseason (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
round TEXT,
pos TEXT,
g INTEGER,
gs NUMERIC,
inn_outs NUMERIC,
po INTEGER,
a INTEGER,
e INTEGER,
dp INTEGER,
tp INTEGER,
pb NUMERIC,
sb NUMERIC,
cs NUMERIC
)
CREATE TABLE fielding (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
league_id TEXT,
pos TEXT,
g INTEGER,
gs NUMERIC,
inn_outs NUMERIC,
po NUMERIC,
a NUMERIC,
e NUMERIC,
dp NUMERIC,
pb NUMERIC,
wp NUMERIC,
sb NUMERIC,
cs NUMERIC,
zr NUMERIC
)
CREATE TABLE all_star (
player_id TEXT,
year INTEGER,
game_num INTEGER,
game_id TEXT,
team_id TEXT,
league_id TEXT,
gp NUMERIC,
starting_pos NUMERIC
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show me the trend about what is the average number of attendance at home games for each year?, sort in asc by the x-axis.
| SELECT year, AVG(attendance) FROM home_game GROUP BY year ORDER BY year | nvbench |
CREATE TABLE item (
i_id number,
title text
)
CREATE TABLE review (
a_id number,
u_id number,
i_id number,
rating number,
rank number
)
CREATE TABLE useracct (
u_id number,
name text
)
CREATE TABLE trust (
source_u_id number,
target_u_id number,
trust number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the titles of items that received any rating below 5.
| SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5 | spider |
CREATE TABLE table_name_16 (
result VARCHAR,
week VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the result for the week higher than 7 on november 4, 1979?
| SELECT result FROM table_name_16 WHERE week > 7 AND date = "november 4, 1979" | sql_create_context |
CREATE TABLE table_66061 (
"Chassis code" text,
"Model Years" text,
"Model" text,
"Engine" text,
"No. built" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the years that has a chassis code of W116.025 and number built was more than 150,593?
| SELECT "Model Years" FROM table_66061 WHERE "No. built" > '150,593' AND "Chassis code" = 'w116.025' | wikisql |
CREATE TABLE table_name_46 (
date_of_departure VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Brendan Rodgers depart his position?
| SELECT date_of_departure FROM table_name_46 WHERE name = "brendan rodgers" | sql_create_context |
CREATE TABLE table_43816 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event had a win, record of 8-1 and n/a round?
| SELECT "Event" FROM table_43816 WHERE "Res." = 'win' AND "Round" = 'n/a' AND "Record" = '8-1' | wikisql |
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,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when was patient 88079 last admitted to the hospital via phys referral/normal deli since 3 years ago?
| SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 88079 AND admissions.admission_location = 'phys referral/normal deli' AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_36 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the score for december 5
| SELECT score FROM table_name_36 WHERE date = "december 5" | sql_create_context |
CREATE TABLE table_5505 (
"Name" text,
"Lifespan" text,
"Country" text,
"Wins" real,
"Majors" real,
"Winning span" text,
"Span (years)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What lifespan has a majors greater than 1, and fuzzy zoeller as the name?
| SELECT "Lifespan" FROM table_5505 WHERE "Majors" > '1' AND "Name" = 'fuzzy zoeller' | wikisql |
CREATE TABLE table_67614 (
"Year" real,
"Series title" text,
"Chinese title" text,
"Role" text,
"Channel" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The highest year for the series titled dragon laws ii: kidnapped is what?
| SELECT MAX("Year") FROM table_67614 WHERE "Series title" = 'dragon laws ii: kidnapped' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For those employees who did not have any job in the past, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart, and could you list by the Y in descending please?
| SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC | nvbench |
CREATE TABLE table_name_97 (
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What competition was held on the date 6/7/03
| SELECT competition FROM table_name_97 WHERE date = "6/7/03" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_ZYJZJLB text
)
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 text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
YLJGDM text,
ZSEBZ number,
ZZBZ number,
ZZYSGH 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,
ZYLBDM text,
ZYMC 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,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 标本在检验报告单14182284037中的代码、名称和状态都是啥?
| SELECT jybgb.BBDM, jybgb.BBMC, jybgb.BBZT FROM jybgb WHERE jybgb.BGDH = '14182284037' | css |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id number,
medicine_id number,
interaction_type text
)
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosome text,
omim number,
porphyria text
)
CREATE TABLE medicine (
id number,
name text,
trade_name text,
fda_approved text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with.
| SELECT T1.id, T1.name, T1.fda_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC | spider |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For those employees who do not work in departments with managers that have ids between 100 and 200, find phone_number and commission_pct , and visualize them by a bar chart, and could you sort y-axis in ascending order?
| SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT | nvbench |
CREATE TABLE table_13907 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time has a Set 1 of 18 25?
| SELECT "Time" FROM table_13907 WHERE "Set 1" = '18–25' | wikisql |
CREATE TABLE table_59983 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people on average attended when Eastwood Town was the away team, and the tie number was less than 8?
| SELECT AVG("Attendance") FROM table_59983 WHERE "Tie no" < '8' AND "Away team" = 'eastwood town' | wikisql |
CREATE TABLE table_name_3 (
casualties VARCHAR,
intensity VARCHAR,
epicenter VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many casualties were in the earthquake with an unknown intensity and an epicenter in the bou ra province?
| SELECT casualties FROM table_name_3 WHERE intensity = "unknown" AND epicenter = "bouïra province" | sql_create_context |
CREATE TABLE table_name_26 (
mountains_classification VARCHAR,
points_classification VARCHAR,
general_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the mountains classification when the points classification is Alessandro Petacchi and the general classification is Danilo Di Luca?
| SELECT mountains_classification FROM table_name_26 WHERE points_classification = "alessandro petacchi" AND general_classification = "danilo di luca" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG number,
FLX_MED_ORG_ID text,
MED_SER_ORG_NO text,
CLINIC_TYPE text,
MED_TYPE number,
CLINIC_ID text,
IN_DIAG_DIS_CD text,
IN_DIAG_DIS_NM text,
OUT_DIAG_DIS_CD text,
OUT_DIAG_DIS_NM text,
INPT_AREA_BED text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
OUT_DIAG_DOC_CD text,
OUT_DIAG_DOC_NM text,
MAIN_COND_DES text,
INSU_TYPE text,
IN_HOSP_DAYS number,
MED_AMOUT number,
FERTILITY_STS number,
DATA_ID text,
SYNC_TIME time,
REIMBURSEMENT_FLG number,
HOSP_LEV number,
HOSP_STS number,
INSURED_IDENTITY number,
SERVANT_FLG text,
TRADE_TYPE number,
INSURED_STS text,
REMOTE_SETTLE_FLG text
)
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 number,
ILL_PAY number,
CIVIL_SUBSIDY number,
PER_SOL number,
PER_EXP number,
DATA_ID text,
SYNC_TIME time,
OUT_HOSP_DATE time,
CLINIC_ID text,
MED_TYPE number,
INSURED_STS text,
INSURED_IDENTITY number,
TRADE_TYPE number,
RECIPE_BILL_ID text,
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
REIMBURS_FLG number,
SENDER_DEAL_ID text,
RECEIVER_DEAL_ID text,
SENDER_REVOKE_ID text,
RECEIVER_REVOKE_ID text,
SENDER_OFFSET_ID text,
RECEIVER_OFFSET_ID text,
LAS_OVE_PAY number,
OVE_ADD_PAY number,
SUP_ADD_PAY number,
CKC102 number,
CASH_PAY number,
COM_ACC_PAY number,
ENT_ACC_PAY number,
ENT_PAY number,
COM_PAY number,
OLDC_FUND_PAY number,
SPE_FUND_PAY number
)
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,
VAL_UNIT text,
DOSE_UNIT text,
DOSE_FORM text,
SPEC text,
USE_FRE text,
EACH_DOSAGE text,
QTY number,
UNIVALENT number,
AMOUNT number,
SELF_PAY_PRO number,
RER_SOL number,
SELF_PAY_AMO number,
UP_LIMIT_AMO number,
OVE_SELF_AMO number,
EXP_OCC_DATE time,
RECIPE_BILL_ID text,
FLX_MED_ORG_ID text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
REF_STA_FLG number,
DATA_ID text,
SYNC_TIME time,
PRESCRIPTION_CODE text,
PRESCRIPTION_ID text,
TRADE_TYPE number,
STA_FLG number,
STA_DATE time,
REIMBURS_TYPE number,
FXBZ number,
REMOTE_SETTLE_FLG text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 列出所有异地结算的费用明细项目,编号是83496462018的那次医疗就诊
| SELECT MED_EXP_DET_ID FROM t_kc22 WHERE MED_CLINIC_ID = '83496462018' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2') | css |
CREATE TABLE table_name_6 (
team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the team leading on August 17?
| SELECT team FROM table_name_6 WHERE date = "august 17" | sql_create_context |
CREATE TABLE table_14559 (
"Opponent" text,
"OVERALL" text,
"HOME" text,
"AWAY" text,
"PLYFF" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Overall has a playoff record of (0-1) and an away record of (1-1)?
| SELECT "OVERALL" FROM table_14559 WHERE "PLYFF" = '(0-1)' AND "AWAY" = '(1-1)' | wikisql |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptroller text,
attorney_general text,
us_senate text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the 3 counties with the smallest population.
| SELECT county_name FROM county ORDER BY population LIMIT 3 | spider |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,
YQMC text,
CKZFWDX text,
CKZFWXX number,
CKZFWSX number,
JLDW text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM text,
CYBQMC text,
CYCWH text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text,
MZBMLX number,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM text,
RYSJ time,
CYSJ time,
CYZTDM number
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE 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 text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
JYKSBM text,
JYKSMC text,
BGJGDM text,
BGJGMC text,
SQRQ time,
CJRQ time,
JYRQ time,
BGSJ time,
BBDM text,
BBMC text,
JYBBH text,
BBZT number,
BBCJBW text,
JSBBSJ time,
JYXMMC text,
JYXMDM text,
JYSQJGMC text,
JYJGMC text,
JSBBRQSJ time,
JYJSQM text,
JYJSGH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
ZZYSGH text,
QTJZYSGH text,
JZZDBM text,
JZZDSM text,
MZZYZDZZBM text,
MZZYZDZZMC text,
SG number,
TZ number,
TW number,
SSY number,
SZY number,
XL number,
HXPLC number,
ML number,
JLSJ time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 查看一下患者蒋夏彤在二零二一年十月二日到二零一七年八月六日内被开出的所有检验报告单的检验报告单号好嘛
| (SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '蒋夏彤' AND jybgb.BGRQ BETWEEN '2011-10-02' AND '2017-08-06') UNION (SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb 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 AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE person_info.XM = '蒋夏彤' AND jybgb.BGRQ BETWEEN '2011-10-02' AND '2017-08-06') | css |
CREATE TABLE TRACK (
GenreId VARCHAR
)
CREATE TABLE GENRE (
GenreId VARCHAR,
Name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the duration of the longest and shortest pop tracks in milliseconds?
| SELECT MAX(Milliseconds), MIN(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Pop" | sql_create_context |
CREATE TABLE table_name_27 (
time VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long was his fight against kim kyoung-suk?
| SELECT time FROM table_name_27 WHERE opponent = "kim kyoung-suk" | 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 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
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of patients diagnosed under icd9 code 25013 whose death status is 1?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "25013" | mimicsql_data |
CREATE TABLE table_2562572_56 (
settlement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the settlement destiny in Aleksandrovo?
| SELECT settlement AS destiny FROM table_2562572_56 WHERE settlement = "Aleksandrovo" | sql_create_context |
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,
INSU_TYPE text,
IN_DIAG_DIS_CD text,
IN_DIAG_DIS_NM text,
IN_HOSP_DATE time,
IN_HOSP_DAYS number,
MAIN_COND_DES text,
MED_AMOUT number,
MED_CLINIC_ID text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
MED_SER_ORG_NO text,
MED_TYPE number,
OUT_DIAG_DIS_CD text,
OUT_DIAG_DIS_NM text,
OUT_DIAG_DOC_CD text,
OUT_DIAG_DOC_NM text,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
PERSON_AGE number,
PERSON_ID text,
PERSON_NM text,
PERSON_SEX number,
REIMBURSEMENT_FLG number,
REMOTE_SETTLE_FLG text,
SERVANT_FLG text,
SOC_SRT_CARD text,
SYNC_TIME time,
TRADE_TYPE number
)
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 text,
MED_DIRE_NM text,
MED_EXP_BILL_ID text,
MED_EXP_DET_ID text,
MED_INV_ITEM_TYPE text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_SELF_AMO number,
PRESCRIPTION_CODE text,
PRESCRIPTION_ID text,
QTY number,
RECIPE_BILL_ID text,
REF_STA_FLG number,
REIMBURS_TYPE number,
REMOTE_SETTLE_FLG text,
RER_SOL number,
SELF_PAY_AMO number,
SELF_PAY_PRO number,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
SPEC text,
STA_DATE time,
STA_FLG number,
SYNC_TIME time,
TRADE_TYPE number,
UNIVALENT number,
UP_LIMIT_AMO number,
USE_FRE text,
VAL_UNIT text
)
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
FLX_MED_ORG_ID text,
ILL_PAY number,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
LAS_OVE_PAY number,
MED_AMOUT number,
MED_SAFE_PAY_ID text,
MED_TYPE number,
OLDC_FUND_PAY number,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_ADD_PAY number,
OVE_PAY number,
PERSON_ID text,
PER_ACC_PAY number,
PER_EXP number,
PER_SOL number,
RECEIVER_DEAL_ID text,
RECEIVER_OFFSET_ID text,
RECEIVER_REVOKE_ID text,
RECIPE_BILL_ID text,
REF_SLT_FLG number,
REIMBURS_FLG number,
SENDER_DEAL_ID text,
SENDER_OFFSET_ID text,
SENDER_REVOKE_ID text,
SPE_FUND_PAY number,
SUP_ADD_PAY number,
SYNC_TIME time,
TRADE_TYPE number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 在哪几次医疗记录中,患者02519154被开出过金额不低于6518.86元的药品?列出有什么医疗就诊编号?
| SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '02519154' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6518.86) | css |
CREATE TABLE table_name_89 (
finish VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the finish for 1992?
| SELECT finish FROM table_name_89 WHERE year = 1992 | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Draw a bar chart about the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home, and could you show by the X in descending?
| SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC | 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 text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
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 text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
YLJGDM text,
ZSEBZ number,
ZZBZ number,
ZZYSGH text
)
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,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB 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,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 请提供云秀美这位病患从17.9.12起,截止到20.12.29期间就诊医生数
| SELECT COUNT(mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX WHERE person_info.XM = '云秀美' AND mzjzjlb.JZKSRQ BETWEEN '2017-09-12' AND '2020-12-29' | css |
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,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text
)
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 text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
ZSEBZ number,
ZZBZ number,
ZZYSGH text,
mzjzjlb_id number
)
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 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 text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC text
)
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 门诊诊断为疾病Y80.333的病人的检测指标145181数值的平均值是多少?最值是多少?
| SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id WHERE mzjzjlb.JZZDBM = 'Y80.333' AND jyjgzbb.JCZBDM = '145181' | css |
CREATE TABLE table_42571 (
"Match" real,
"Date" text,
"Home/Away" text,
"Opponent team" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest match when the away opponent was Dalian Shide Siwu?
| SELECT MAX("Match") FROM table_42571 WHERE "Opponent team" = 'dalian shide siwu' AND "Home/Away" = 'away' | wikisql |
CREATE TABLE fgwyjzb (
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,
INSU_TYPE text,
IN_DIAG_DIS_CD text,
IN_DIAG_DIS_NM text,
IN_HOSP_DATE time,
IN_HOSP_DAYS number,
MAIN_COND_DES text,
MED_AMOUT number,
MED_CLINIC_ID number,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
MED_SER_ORG_NO text,
MED_TYPE number,
OUT_DIAG_DIS_CD text,
OUT_DIAG_DIS_NM text,
OUT_DIAG_DOC_CD text,
OUT_DIAG_DOC_NM text,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
PERSON_AGE number,
PERSON_ID text,
PERSON_NM text,
PERSON_SEX number,
REIMBURSEMENT_FLG number,
REMOTE_SETTLE_FLG text,
SOC_SRT_CARD text,
SYNC_TIME time,
TRADE_TYPE number
)
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,
FLX_MED_ORG_ID text,
ILL_PAY number,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
LAS_OVE_PAY number,
MED_AMOUT number,
MED_CLINIC_ID text,
MED_SAFE_PAY_ID text,
MED_TYPE number,
OLDC_FUND_PAY number,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_ADD_PAY number,
OVE_PAY number,
PERSON_ID text,
PER_ACC_PAY number,
PER_EXP number,
PER_SOL number,
RECEIVER_DEAL_ID text,
RECEIVER_OFFSET_ID text,
RECEIVER_REVOKE_ID text,
RECIPE_BILL_ID text,
REF_SLT_FLG number,
REIMBURS_FLG number,
SENDER_DEAL_ID text,
SENDER_OFFSET_ID text,
SENDER_REVOKE_ID text,
SPE_FUND_PAY number,
SUP_ADD_PAY number,
SYNC_TIME time,
TRADE_TYPE number
)
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 text,
MED_DIRE_NM text,
MED_EXP_BILL_ID text,
MED_EXP_DET_ID text,
MED_INV_ITEM_TYPE text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_SELF_AMO number,
PRESCRIPTION_CODE text,
PRESCRIPTION_ID text,
QTY number,
RECIPE_BILL_ID text,
REF_STA_FLG number,
REIMBURS_TYPE number,
REMOTE_SETTLE_FLG text,
RER_SOL number,
SELF_PAY_AMO number,
SELF_PAY_PRO number,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
SPEC text,
STA_DATE time,
STA_FLG number,
SYNC_TIME time,
TRADE_TYPE number,
UNIVALENT number,
UP_LIMIT_AMO number,
USE_FRE text,
VAL_UNIT text
)
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,
INSU_TYPE text,
IN_DIAG_DIS_CD text,
IN_DIAG_DIS_NM text,
IN_HOSP_DATE time,
IN_HOSP_DAYS number,
MAIN_COND_DES text,
MED_AMOUT number,
MED_CLINIC_ID number,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
MED_SER_ORG_NO text,
MED_TYPE number,
OUT_DIAG_DIS_CD text,
OUT_DIAG_DIS_NM text,
OUT_DIAG_DOC_CD text,
OUT_DIAG_DOC_NM text,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
PERSON_AGE number,
PERSON_ID text,
PERSON_NM text,
PERSON_SEX number,
REIMBURSEMENT_FLG number,
REMOTE_SETTLE_FLG text,
SOC_SRT_CARD text,
SYNC_TIME time,
TRADE_TYPE number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 哪些药品的是应对患有维生素B缺乏病的病患开具的它们的名称和编号是什么?
| SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_NM = '维生素B缺乏病' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_DIS_NM = '维生素B缺乏病' | css |
CREATE TABLE table_17650725_1 (
internal_transfers INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least internal transfers
| SELECT MIN(internal_transfers) FROM table_17650725_1 | sql_create_context |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the ids and details of events that have more than one participants Visualize by bar chart, and I want to display by the names from high to low please.
| SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_Details DESC | nvbench |
CREATE TABLE table_13093 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whate place has 18 points with lost less than 8?
| SELECT COUNT("Place") FROM table_13093 WHERE "Points" = '18' AND "Lost" < '8' | wikisql |
CREATE TABLE Products (
product_id INTEGER,
product_details VARCHAR(255)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
address_type VARCHAR(15),
date_address_to DATETIME
)
CREATE TABLE Customer_Contact_Channels (
customer_id INTEGER,
channel_code VARCHAR(15),
active_from_date DATETIME,
active_to_date DATETIME,
contact_number VARCHAR(50)
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_method VARCHAR(15),
customer_name VARCHAR(80),
date_became_customer DATETIME,
other_customer_details VARCHAR(255)
)
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status VARCHAR(15),
order_date DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Addresses (
address_id INTEGER,
address_content VARCHAR(80),
city VARCHAR(50),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50),
other_address_details VARCHAR(255)
)
CREATE TABLE Order_Items (
order_id INTEGER,
product_id INTEGER,
order_quantity VARCHAR(15)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of customers that use email as the contact channel for each year Visualize with a bar chart, display by the the number of active from date in desc.
| SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' ORDER BY COUNT(active_from_date) DESC | nvbench |
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
doubles_wl text,
team number
)
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
draft_pick_number number,
draft_class text,
college text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the name of colleges that have at least two players in descending alphabetical order.
| SELECT college FROM match_season GROUP BY college HAVING COUNT(*) >= 2 ORDER BY college DESC | spider |
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
)
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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of patients with lab test item id 51248?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51248" | mimicsql_data |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
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 TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what 's the cheapest flight from DENVER to PITTSBURGH
| 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'DENVER' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'PITTSBURGH' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id | atis |
CREATE TABLE table_29147 (
"No. in total" text,
"No. in series" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number in series of the episode titled 'beauty and the beast'?
| SELECT "No. in series" FROM table_29147 WHERE "Title" = 'Beauty and the Beast' | wikisql |
CREATE TABLE medicine (
name VARCHAR,
trade_name VARCHAR
)
CREATE TABLE enzyme (
id VARCHAR,
product VARCHAR
)
CREATE TABLE medicine_enzyme_interaction (
medicine_id VARCHAR,
enzyme_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the medicine names and trade names that cannot interact with the enzyme with product 'Heme'.
| SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX' | sql_create_context |
CREATE TABLE table_26202847_6 (
no VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On the date October 21, 2007, what is the No.?
| SELECT no FROM table_26202847_6 WHERE date = "October 21, 2007" | sql_create_context |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.