instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE keyword (
keyword varchar,
kid int
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE domain_journal (
did int,
jid int
)
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE cite (
... | SELECT journal.name FROM author, journal, publication, writes WHERE author.name = 'H. V. Jagadish' AND publication.jid = journal.jid AND writes.aid = author.aid AND writes.pid = publication.pid GROUP BY journal.name HAVING COUNT(DISTINCT (publication.title)) > 10 | academic |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCHAR(40),
Credits INTEGER,
Instructor INTEGER,
Days VAR... | SELECT CID, Credits FROM Course ORDER BY Credits | nvbench |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_37924 (
"Rank" real,
"Province" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team had less than 291 total points whole having 76 bronze and over 21 gold?
| SELECT SUM("Silver") FROM table_37924 WHERE "Gold" > '21' AND "Bronze" = '76' AND "Total" < '291' | wikisql |
CREATE TABLE table_70188 (
"Year" text,
"Venue" text,
"Winners" text,
"Runner-up" text,
"3rd place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the runner-up when Polonia Bydgoszcz won and Mega-Lada Togliatti finished 3rd?
| SELECT "Runner-up" FROM table_70188 WHERE "Winners" = 'polonia bydgoszcz' AND "3rd place" = 'mega-lada togliatti' | wikisql |
CREATE TABLE table_42776 (
"Club" text,
"Position in 2012" text,
"First season in top division" real,
"Number of seasons in Meistriliiga" real,
"First season of current spell in top division" real,
"Top division titles" real
)
-- Using valid SQLite, answer the following questions for the table... | SELECT COUNT("Number of seasons in Meistriliiga") FROM table_42776 WHERE "Club" = 'kuressaare' AND "First season in top division" > '2000' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.JYXMDM, jybgb.JYXMMC FROM jybgb WHERE jybgb.BGDH = '70540908797' | css |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistory (
Id number,
... | SELECT q.Id AS "post_link" FROM Posts AS q INNER JOIN Users AS u ON u.Id = q.OwnerUserId INNER JOIN PostHistory AS ph ON ph.Id = q.Id WHERE q.PostTypeId = 1 AND DATEDIFF(DAY, q.CreationDate, GETDATE()) > 365 AND q.Score = 0 AND q.AnswerCount = 0 AND ph.PostHistoryTypeId != 14 AND q.ViewCount < DATEDIFF(DAY, q.CreationD... | sede |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE p... | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE table_name_90 (
location VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the location when the record is 5-1-1?
| SELECT location FROM table_name_90 WHERE record = "5-1-1" | sql_create_context |
CREATE TABLE table_3705 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Phil Klemmer wrote... | SELECT "Title" FROM table_3705 WHERE "Written by" = 'Phil Klemmer' AND "Production code" = '3T6455' | wikisql |
CREATE TABLE table_34538 (
"IN No." real,
"County Name" text,
"County Seat" text,
"Time Zone" text,
"Population (2010) (Rank)" text,
"Area sq mi (km 2 ) (Rank)" text,
"Twps" real,
"ZIP code Prefix(es)" text,
"% of Boundary by water" text
)
-- Using valid SQLite, answer the followin... | SELECT "ZIP code Prefix(es)" FROM table_34538 WHERE "County Seat" = 'boonville' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-158213')) AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE table_name_14 (
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the visitor on May 9?
| SELECT visitor FROM table_name_14 WHERE date = "may 9" | sql_create_context |
CREATE TABLE table_77747 (
"Index" text,
"Organization" text,
"Year" real,
"Rank" text,
"Out of" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year is the happy planet index?
| SELECT SUM("Year") FROM table_77747 WHERE "Index" = 'happy planet index' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Road, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 90663) AND icustays.outtime IS NULL | mimic_iii |
CREATE TABLE table_11884 (
"Date" text,
"Opponent" text,
"Score" text,
"Site/Stadium" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which site/stadium was the score 1-2?
| SELECT "Site/Stadium" FROM table_11884 WHERE "Score" = '1-2' | wikisql |
CREATE TABLE table_name_72 (
name VARCHAR,
transfer_window VARCHAR,
transfer_fee VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player had a transfer window of winter, and free as the transfer fee?
| SELECT name FROM table_name_72 WHERE transfer_window = "winter" AND transfer_fee = "free" | sql_create_context |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
... | SELECT q.Id AS "post_link", q.Score, q.OwnerUserId AS "user_link", q.Tags FROM Posts AS q INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JOIN Tags AS t ON t.Id = pt.TagId LEFT OUTER JOIN Posts AS a ON a.ParentId = q.Id AND a.OwnerUserId = '##userid##' WHERE TagName = '##tagname:string##' AND a.Id IS NULL ORDER BY ... | sede |
CREATE TABLE table_name_36 (
outgoing_manager VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHo was the outgoing manager for the team of fc carl zeiss jena?
| SELECT outgoing_manager FROM table_name_36 WHERE team = "fc carl zeiss jena" | sql_create_context |
CREATE TABLE table_name_60 (
status VARCHAR,
network_affiliation VARCHAR,
station VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status of the independent station KPFB?
| SELECT status FROM table_name_60 WHERE network_affiliation = "independent" AND station = "kpfb" | 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 numb... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '70821376' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Cerebral embolism with cerebral infarction" | mimicsql_data |
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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "63" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_55766 (
"Years" text,
"Displacement" text,
"Engine" text,
"Power" text,
"Torque" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Displacement has 185hp (138kw) Power o
| SELECT "Displacement" FROM table_55766 WHERE "Power" = '185hp (138kw)' | wikisql |
CREATE TABLE table_72036 (
"Code Name" text,
"Function (figure)" text,
"Real Name" text,
"Birthplace" text,
"Serial number" text,
"Primary military speciality" text,
"Secondary military speciality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Real Name" FROM table_72036 WHERE "Primary military speciality" = 'shock paratrooper' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2111-12-31 12:16:00" | mimicsql_data |
CREATE TABLE table_58157 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average events for miller barber
| SELECT AVG("Events") FROM table_58157 WHERE "Player" = 'miller barber' | wikisql |
CREATE TABLE table_43742 (
"Season" real,
"Overall" real,
"Slalom" text,
"Giant Slalom" real,
"Super G" text,
"Downhill" text,
"Combined" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Super G when the combined was 13 and the over... | SELECT "Super G" FROM table_43742 WHERE "Overall" > '7' AND "Combined" = '13' | wikisql |
CREATE TABLE table_45984 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date in Week 7 with an Attendance greater than 44,000?
| SELECT "Date" FROM table_45984 WHERE "Attendance" > '44,000' AND "Week" = '7' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.long_title = "Closed [needle] biopsy of tongue" | mimicsql_data |
CREATE TABLE table_name_61 (
venue VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue when the score was 8-2?
| SELECT venue FROM table_name_61 WHERE score = "8-2" | sql_create_context |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE author (
authorid int,
authorname... | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'hal perkins' AND writes.authorid = author.authorid | scholar |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "PO" | mimicsql_data |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC | nvbench |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | SELECT qu.OwnerUserId AS QuestionerId, qu.Id AS QuestionId, qu.CreationDate AS QuestionDate, qu.Title AS QuestionTitle, qu.Body AS QuestionBody, qu.Tags AS QuestionTags, an.Id AS AnswerId, an.Body AS AnswerBody, an.OwnerUserId AS AnswererId, an.CreationDate AS AnswerDate, ROW_NUMBER() OVER (ORDER BY qu.CreationDate DES... | sede |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '马华美' AND hz_info.YLJGDM = '8433751' AND NOT zyjzjlb.CYKSMC LIKE '%角膜%' | css |
CREATE TABLE table_71152 (
"Ensemble" text,
"Gold Medals" real,
"Silver Medals" real,
"Bronze Medals" real,
"Total Medals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many gold medals for the school with less than 1 total?
| SELECT COUNT("Gold Medals") FROM table_71152 WHERE "Total Medals" < '1' | wikisql |
CREATE TABLE table_9507 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Points, when Year is after 1959, and when Class is 250cc?
| SELECT SUM("Points") FROM table_9507 WHERE "Year" > '1959' AND "Class" = '250cc' | wikisql |
CREATE TABLE table_8687 (
"Winner" text,
"Country" text,
"Winter Olympics" text,
"FIS Nordic World Ski Championships" text,
"Holmenkollen" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Winter Olympics was Japan as the country?
| SELECT "Winter Olympics" FROM table_8687 WHERE "Country" = 'japan' | wikisql |
CREATE TABLE table_36581 (
"Player" text,
"Touchdowns (5 points)" real,
"Extra points 1 point" real,
"Field goals (5 points)" real,
"Total Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Field goals (5 points) have a Total Points of ... | SELECT COUNT("Field goals (5 points)") FROM table_36581 WHERE "Total Points" = '123' AND "Touchdowns (5 points)" > '13' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '韦宜然' AND t_kc22.STA_DATE BETWEEN '2011-09-02' AND '2012-12-04' AND t_kc21.MED_SER_ORG_NO = '2066190' AND t_kc22.MED_INV_ITEM... | css |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyj... | css |
CREATE TABLE table_15736385_1 (
engine VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What engine does Galles Racing use?
| SELECT engine FROM table_15736385_1 WHERE team = "Galles Racing" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto 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 labevents (
row_id number,
... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.l... | mimic_iii |
CREATE TABLE table_22056184_1 (
position VARCHAR,
f_laps VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many positions have f/laps of 1 and british formula three series?
| SELECT COUNT(position) FROM table_22056184_1 WHERE f_laps = 1 AND series = "British Formula Three" | sql_create_context |
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 ... | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96728)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ost... | mimic_iii |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-10135')) AND medication.drugname = 'glucagon (human recombinant) 1 mg/... | eicu |
CREATE TABLE table_40615 (
"T568A Pair" real,
"T568B Pair" real,
"Wire" text,
"T568A Color" text,
"T568B Color" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the T568A color for the cable with a white/orange stripe T568B color?
| SELECT "T568A Color" FROM table_40615 WHERE "T568B Color" = 'white/orange stripe' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "81" AND diagnoses.short_title = "Polymyalgia rheumatica" | mimicsql_data |
CREATE TABLE table_204_318 (
id number,
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" number,
"scorers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which game had more in attendance , cardiff city or reading ?
| SELECT "opponent" FROM table_204_318 WHERE "opponent" IN ('cardiff city', 'reading') ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE table_575 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the followi... | SELECT "Tries for" FROM table_575 WHERE "Tries against" = '33' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" | mimicsql_data |
CREATE TABLE table_name_2 (
record VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record of the 2013 Nassau Games?
| SELECT record FROM table_name_2 WHERE games = "2013 nassau" | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | SELECT COUNT(DISTINCT COURSE_PREREQUISITEalias0.course_id), COURSEalias0.department, COURSEalias0.name, COURSEalias0.number FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course AS COURSEalias1, course_offering AS COURSE_OFFERINGali... | advising |
CREATE TABLE table_name_27 (
term_in_office VARCHAR,
member VARCHAR,
party VARCHAR,
state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the term in office for liberal and state of sa for ian mclachlan
| SELECT term_in_office FROM table_name_27 WHERE party = "liberal" AND state = "sa" AND member = "ian mclachlan" | sql_create_context |
CREATE TABLE table_name_49 (
first_elected INTEGER,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average First Elected, when District is 'Massachusetts 3'?
| SELECT AVG(first_elected) FROM table_name_49 WHERE district = "massachusetts 3" | sql_create_context |
CREATE TABLE table_2249029_1 (
gdp_world_rank VARCHAR,
asian_rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the gdp world rank for asian rank being 15
| SELECT gdp_world_rank FROM table_2249029_1 WHERE asian_rank = 15 | sql_create_context |
CREATE TABLE table_60801 (
"Episode" text,
"1 season" text,
"2 season" text,
"3 season" text,
"4 season" text,
"5 season" text,
"6 season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 1 Season, when 4 Season is '2 101 043 (13 May 2... | SELECT "1 season" FROM table_60801 WHERE "4 season" = '2 101 043 (13 may 2009)' | 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
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND diagnoses.long_title = "Unspecified osteomyelitis, other specified sites" | mimicsql_data |
CREATE TABLE table_4135 (
"Stadium" text,
"Location" text,
"Opened" real,
"Built for" text,
"Capacity at Construction" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the stadium in Adelaide, South Australia built for?
| SELECT "Built for" FROM table_4135 WHERE "Location" = 'Adelaide, South Australia' | wikisql |
CREATE TABLE table_74728 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning score when there were 9 strokes advantage?
| SELECT "Winning score" FROM table_74728 WHERE "Margin of victory" = '9 strokes' | wikisql |
CREATE TABLE table_1473672_8 (
college_junior_club_team VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the college/junior/club team for left wing
| SELECT college_junior_club_team FROM table_1473672_8 WHERE position = "Left Wing" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID 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,
H... | SELECT t_kc21.IN_HOSP_DAYS FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '26786067488' | css |
CREATE TABLE table_79002 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT GOALS A... | SELECT SUM("Goals Against") FROM table_79002 WHERE "Goals For" = '46' AND "Played" < '38' | wikisql |
CREATE TABLE table_29164 (
"Chambering" text,
"P1 diameter (mm)" text,
"A external (cm 2 )" text,
"P max ( bar )" real,
"F bolt ( kgf )" real,
"F bolt" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With what type of chambering is the F bolt n (... | SELECT "Chambering" FROM table_29164 WHERE "F bolt" = 'N (lbf)' AND "P max ( bar )" = '3900' | wikisql |
CREATE TABLE table_21173 (
"Year" real,
"Tournaments played" real,
"Cuts made" real,
"Wins" real,
"Best finish" text,
"Earnings ( $ )" real,
"Money list rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was Casey Martin's minimum yea... | SELECT MIN("Earnings ( $ )") FROM table_21173 | wikisql |
CREATE TABLE table_name_12 (
de_laet__1633_ VARCHAR,
munsee_delaware VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the De Laet term for a Munsee Delaware term of n a?
| SELECT de_laet__1633_ FROM table_name_12 WHERE munsee_delaware = "ní·ša" | sql_create_context |
CREATE TABLE table_23599 (
"Draw" real,
"Artist" text,
"Song" text,
"Regions" real,
"Studio Audience" real,
"Press Jury" real,
"Oil Rig" real,
"Total Points" real,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many point... | SELECT MIN("Total Points") FROM table_23599 WHERE "Song" = 'Stille før stormen' | wikisql |
CREATE TABLE table_1671401_3 (
top_5 VARCHAR,
winnings VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- name the top 5 where the winnings is $52,595
| SELECT top_5 FROM table_1671401_3 WHERE winnings = "$52,595" | sql_create_context |
CREATE TABLE table_12216 (
"Name" text,
"GP-GS" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lowest avg/g for a GP-GS of 12-12 and a gain less than 16?
| SELECT MIN("Avg/G") FROM table_12216 WHERE "GP-GS" = '12-12' AND "Gain" < '16' | 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 ... | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19412 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE table_19169 (
"State" text,
"Highest point" text,
"Highest elevation" text,
"Lowest point" text,
"Lowest elevation" text,
"Mean elevation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the state with highest point being moun... | SELECT "State" FROM table_19169 WHERE "Highest point" = 'Mount Katahdin' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" AND demographic.age < "68" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.short_title = "Heart valve transplant" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT demographic.gender, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_n... | SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.id = location.restaurant_id AND restaurant.name = 'denny' | restaurants |
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,
... | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG... | css |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
... | SELECT name, ID FROM swimmer ORDER BY ID DESC | nvbench |
CREATE TABLE table_28059992_1 (
pick__number VARCHAR,
cfl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many pick# for CFL team of Toronto Argonauts?
| SELECT COUNT(pick__number) FROM table_28059992_1 WHERE cfl_team = "Toronto Argonauts" | sql_create_context |
CREATE TABLE table_278229_1 (
commandery VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when changsha is the commandery what is the commandery capital?
| SELECT commandery AS capital FROM table_278229_1 WHERE commandery = "Changsha 長沙" | sql_create_context |
CREATE TABLE table_41100 (
"Administrative Panel" real,
"Agricultural Panel" real,
"Cultural and Educational Panel" real,
"Industrial and Commercial Panel" real,
"Labour Panel" real,
"National University of Ireland" real,
"University of Dublin" real,
"Nominated by the Taoiseach" real,
... | SELECT SUM("University of Dublin") FROM table_41100 WHERE "Nominated by the Taoiseach" = '2' AND "Industrial and Commercial Panel" > '0' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(txmzjzjlb.ZZYSGH) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '78228979' AND txmzjzjlb.JZKSRQ BETWEEN '2002-10-08' AND '2016-07-03' UNION SELECT COUNT(ftxmzjzjlb.ZZYSGH) FROM hz_info JOIN ftxmzjzjlb ON h... | css |
CREATE TABLE gymnast (
Gymnast_ID int,
Floor_Exercise_Points real,
Pommel_Horse_Points real,
Rings_Points real,
Vault_Points real,
Parallel_Bars_Points real,
Horizontal_Bar_Points real,
Total_Points real
)
CREATE TABLE people (
People_ID int,
Name text,
Age real,
Height ... | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) | nvbench |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_name_72 (
final_episode VARCHAR,
episodes_credited VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final episode credited of 187?
| SELECT final_episode FROM table_name_72 WHERE episodes_credited = 187 | sql_create_context |
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 ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "79" AND diagnoses.short_title = "Human immuno virus dis" | mimicsql_data |
CREATE TABLE table_name_60 (
first_edition VARCHAR,
pages VARCHAR,
isbn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which first edition has 264 pages and the ISBN of 978-0785111832?
| SELECT first_edition FROM table_name_60 WHERE pages = "264" AND isbn = "978-0785111832" | sql_create_context |
CREATE TABLE table_name_85 (
assists VARCHAR,
pims VARCHAR,
goals VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of assists of the player with 0 goals, more than 1 points, and more than 0 pims?
| SELECT COUNT(assists) FROM table_name_85 WHERE goals = 0 AND points > 1 AND pims > 0 | sql_create_context |
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,
JO... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | nvbench |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id 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 ... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj... | css |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
Creati... | SELECT p.Id AS "post_link", p.Score AS "Score", p.Tags AS "Tags" FROM Posts AS p WHERE p.PostTypeId = 1 AND (STR_POSITION(UPPER(p.Title), 'DOUBT') > 0 OR STR_POSITION(UPPER(p.Title), 'QUESTION') > 0 OR STR_POSITION(UPPER(p.Title), 'HELP') > 0 OR STR_POSITION(UPPER(p.Title), 'PROBLEM') > 0 OR (STR_POSITION(UPPER(p.Title... | sede |
CREATE TABLE table_train_58 (
"id" int,
"pregnancy_or_lactation" bool,
"white_blood_cell_count_wbc" int,
"systolic_blood_pressure_sbp" int,
"temperature" float,
"surgery" bool,
"antibiotic_treatment" bool,
"heart_rate" int,
"allergy_to_vitamin_c" bool,
"paco2" float,
"immatur... | SELECT * FROM table_train_58 WHERE pregnancy_or_lactation = 1 | criteria2sql |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases IN... | SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Winery ORDER BY Winery | nvbench |
CREATE TABLE table_1847523_2 (
station VARCHAR,
city_of_license__market VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the stations with a license in Cincinnati?
| SELECT station FROM table_1847523_2 WHERE city_of_license__market = "Cincinnati" | sql_create_context |
CREATE TABLE table_name_8 (
minutes VARCHAR,
goals VARCHAR,
assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of minutes when there are more than 4 goals and 3 assists?
| SELECT minutes FROM table_name_8 WHERE goals > 4 AND assists = 3 | sql_create_context |
CREATE TABLE campuses (
id number,
campus text,
location text,
county text,
year number
)
CREATE TABLE discipline_enrollments (
campus number,
discipline number,
year number,
undergraduate number,
graduate number
)
CREATE TABLE enrollments (
campus number,
year number,
... | SELECT campus FROM degrees GROUP BY campus ORDER BY SUM(degrees) DESC LIMIT 1 | spider |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1... | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY COUNT(Rank) DESC | nvbench |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVING COUNT(Posts.Id) > 10... | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.