instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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, find name and the sum of code , and group by attribute name, and visualize them by a bar chart, and display in descending by the X.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE table_12413 ( "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 7:30 has tout le monde en parle as the 8:00?
SELECT "7:30" FROM table_12413 WHERE "8:00" = 'tout le monde en parle'
wikisql
CREATE TABLE table_31388 ( "Season" text, "Season premiere" text, "Season finale" text, "TV season" text, "Ranking" text, "Viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season was the finale that aired on May 23, 2004?
SELECT "TV season" FROM table_31388 WHERE "Season finale" = 'May 23, 2004'
wikisql
CREATE TABLE table_68462 ( "Series 1" text, "Series 2" text, "Series 3" text, "Series 5" text, "Series 9" text, "Series 11" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who in series 5 corresponds to Deborah Meaden in series 3?
SELECT "Series 5" FROM table_68462 WHERE "Series 3" = 'deborah meaden'
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, 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 hz_info ( KH text, KLX number, YLJGDM 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 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 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_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 68891668患者之前是哪个就诊医院
SELECT mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON 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 AND person_info_hz_info.RYBH = person_info.RYBH WHERE person_info_hz_info.RYBH = '68891668' UNION SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.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 AND person_info_hz_info.RYBH = person_info.RYBH WHERE person_info.RYBH = '68891668'
css
CREATE TABLE table_name_45 ( location_attendance VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance during the game against Philadelphia?
SELECT location_attendance FROM table_name_45 WHERE team = "philadelphia"
sql_create_context
CREATE TABLE table_62951 ( "Team" text, "Tries for" real, "Tries against" real, "Try diff" text, "Points for" real, "Points against" real, "Points diff" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points for has Points against smaller than 93, and Tries for larger than 25?
SELECT MIN("Points for") FROM table_62951 WHERE "Points against" < '93' AND "Tries for" > '25'
wikisql
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 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 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 ) 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times since 658 days ago has patient 1269 received br milk fs ng?
SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1269)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'br milk fs ng' AND d_items.linksto = 'inputevents_cv') AND DATETIME(inputevents_cv.charttime) >= DATETIME(CURRENT_TIME(), '-658 day')
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many of the patients with exteriorization of small intestine remained admitted in hospital for more than 29 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "29" AND procedures.long_title = "Exteriorization of small intestine"
mimicsql_data
CREATE TABLE table_name_94 ( col__m_ INTEGER, prominence__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum Col (m) when 3,046 is the Prominence (m)?
SELECT MAX(col__m_) FROM table_name_94 WHERE prominence__m_ = 3 OFFSET 046
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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 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 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 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 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 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 procedures_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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many days has it been since patient 97330 had received a calcium, total lab test for the last time in this hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_21398 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years was the original title was (swopnodanay)?
SELECT COUNT("Year (Ceremony)") FROM table_21398 WHERE "Original title" = 'স্বপ্নডানায় (Swopnodanay)'
wikisql
CREATE TABLE table_train_252 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "fasting_plasma_glucose_fpg" float, "hemoglobin_a1c_hba1c" float, "hba1c" float, "serum_creatinine" float, "metformin" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- pregnant female aged 18 _ 40 years old.
SELECT * FROM table_train_252 WHERE pregnancy_or_lactation = 1 AND (age >= 18 AND age <= 40)
criteria2sql
CREATE TABLE table_59773 ( "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 episode has 7.8 million viewers?
SELECT "Episode" FROM table_59773 WHERE "Viewers (in millions)" = '7.8'
wikisql
CREATE TABLE procedures_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, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what number of days has it been since the last time patient 19412 was diagnosed with neutropenia nos during the current hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'neutropenia nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19412 AND admissions.dischtime IS NULL) ORDER BY diagnoses_icd.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_51 ( driver VARCHAR, date VARCHAR, position VARCHAR, team VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what driver has a team of officine alfieri maserati and belongs to the class of non-championship f2 and has a position of 2, as well as a date of 9/1952?
SELECT driver FROM table_name_51 WHERE team = "officine alfieri maserati" AND class = "non-championship f2" AND position = 2 AND date = "9/1952"
sql_create_context
CREATE TABLE ref_budget_codes ( budget_type_code text, budget_type_description text ) CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE statements ( statement_id number, statement_details text ) CREATE TABLE documents ( document_id number, document_type_code text, project_id number, document_date time, document_name text, document_description text, other_details text ) CREATE TABLE accounts ( account_id number, statement_id number, account_details text ) CREATE TABLE projects ( project_id number, project_details text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many documents have expenses?
SELECT COUNT(*) FROM documents_with_expenses
spider
CREATE TABLE table_55395 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time or retired time for timo glock with under 70 laps and a grid number greater than 15?
SELECT "Time/Retired" FROM table_55395 WHERE "Laps" < '70' AND "Grid" > '15' AND "Driver" = 'timo glock'
wikisql
CREATE TABLE table_49108 ( "Week" real, "Date" text, "Opponent" text, "Score" text, "Result" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Result is Win, and when Date is Aug 7?
SELECT "Opponent" FROM table_49108 WHERE "Result" = 'win' AND "Date" = 'aug 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 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 ) 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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- provide the number of patients whose admission year is less than 2200 and diagnoses icd9 code is e8791?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2200" AND diagnoses.icd9_code = "E8791"
mimicsql_data
CREATE TABLE table_37346 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance of the game on 2007-04-07 with the Warriors as the visitor team?
SELECT "Attendance" FROM table_37346 WHERE "Visitor" = 'warriors' AND "Date" = '2007-04-07'
wikisql
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. -- Give me the comparison about School_ID over the ACC_Road , and group by attribute ACC_Home by a bar chart, could you display by the Y-axis in desc?
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID DESC
nvbench
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average age of the female students with secretary votes in the spring election cycle?
SELECT AVG(T1.age) FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = secretary_vote WHERE T1.sex = "F" AND T2.election_cycle = "Spring"
spider
CREATE TABLE table_name_52 ( poles INTEGER, fastest_laps INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of poles when the fastest laps are less than 0?
SELECT MIN(poles) FROM table_name_52 WHERE fastest_laps < 0
sql_create_context
CREATE TABLE table_203_118 ( id number, "game" number, "date" text, "opponent" text, "location" text, "score" text, "ot" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total amount of games that the team won by more than 2 points ?
SELECT COUNT(*) FROM table_203_118 WHERE "score" - "score" > 2
squall
CREATE TABLE table_name_91 ( position VARCHAR, pick__number VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does a Keith Shologan, who was picked higher than 6, play?
SELECT position FROM table_name_91 WHERE pick__number < 6 AND player = "keith shologan"
sql_create_context
CREATE TABLE table_41313 ( "Album" text, "Release date" text, "Label" text, "Format" text, "Covered Song" text, "Original Song" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Covered Song when the Album shows cover version iii?
SELECT "Covered Song" FROM table_41313 WHERE "Album" = 'cover version iii'
wikisql
CREATE TABLE Draft_Copies ( document_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many draft copies does the document with id 2 have?
SELECT COUNT(*) FROM Draft_Copies WHERE document_id = 2
sql_create_context
CREATE TABLE table_22905641_2 ( race_1_winner VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the race 1 winner at the race held at Winton Motor Raceway?
SELECT race_1_winner FROM table_22905641_2 WHERE circuit = "Winton Motor Raceway"
sql_create_context
CREATE TABLE table_name_43 ( season INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most recent season with a date of 27 October 1957?
SELECT MAX(season) FROM table_name_43 WHERE date = "27 october 1957"
sql_create_context
CREATE TABLE table_name_26 ( conference VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What conference has the Wichita State school?
SELECT conference FROM table_name_26 WHERE school = "wichita state"
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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many patients whose primary disease is coronary artery disease and admission year is less than 2203?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.admityear < "2203"
mimicsql_data
CREATE TABLE table_203_720 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the 1987 syracuse orangemen football team scored their largest number of points in a game conducted on october 24th , 1987 at the carrier dome in syracuse , ny ; who was the oposing team in that match ?
SELECT "opponent#" FROM table_203_720 WHERE "date" = 'october 24'
squall
CREATE TABLE table_17323092_8 ( date VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What dates did Chris Bosh (18) score the high points?
SELECT date FROM table_17323092_8 WHERE high_points = "Chris Bosh (18)"
sql_create_context
CREATE TABLE table_73778 ( "Driver Unit Model No." text, "Release Year" real, "Output Voltage (RMS)" text, "Inputs" text, "Outputs" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many outputs are there for solid state, battery operated for portable use listed in notes?
SELECT COUNT("Outputs") FROM table_73778 WHERE "Notes" = 'Solid state, battery operated for portable use'
wikisql
CREATE TABLE table_name_20 ( attendance VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance at the game when the record was 35-46?
SELECT attendance FROM table_name_20 WHERE record = "35-46"
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) 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_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 230 is offered next semester when ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 230 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value 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 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 d_icd_diagnoses ( 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the top three most common diagnoses for patients who underwent interruption vena cava that followed within 2 months?
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, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'interruption vena cava')) 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) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t2.charttime) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 3)
mimic_iii
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 ) CREATE TABLE diagnoses ( 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 whose age is less than 85 and lab test name is mcv?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "85" AND lab.label = "MCV"
mimicsql_data
CREATE TABLE table_616 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Area" real, "Population" real, "Density" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people live in the district who's capital is h ngf ng xi n?
SELECT "Population" FROM table_616 WHERE "Pinyin" = 'Héngfēng Xiàn'
wikisql
CREATE TABLE table_58783 ( "Name" text, "Bodyweight" real, "Snatch" text, "Clean & Jerk" text, "Total (kg)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total bodyweight of everyone that has a Snatch of 153.0?
SELECT SUM("Bodyweight") FROM table_58783 WHERE "Snatch" = '153.0'
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 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. -- count the number of patients whose marital status is widowed and diagnoses short title is systolic hrt failure nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.short_title = "Systolic hrt failure NOS"
mimicsql_data
CREATE TABLE table_69780 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- for the 7:30 of access hollywood what is the 10:00?
SELECT "10:00" FROM table_69780 WHERE "7:30" = 'access hollywood'
wikisql
CREATE TABLE table_name_8 ( gold INTEGER, nation VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What amount of Gold does Russia have and have a rank larger than 1?
SELECT SUM(gold) FROM table_name_8 WHERE nation = "russia" AND rank > 1
sql_create_context
CREATE TABLE table_27675 ( "Position" text, "Number" real, "Horse" text, "Jockey" text, "Age" real, "Handicap" text, "SP" text, "Distance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who isthe jockey in 10th position?
SELECT "Jockey" FROM table_27675 WHERE "Position" = '10th'
wikisql
CREATE TABLE table_47323 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE TOTAL NUMBER WITH A ROUND BIGGER THAN 7 AND PICK OF 21?
SELECT COUNT("Overall") FROM table_47323 WHERE "Round" > '7' AND "Pick" = '21'
wikisql
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 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 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 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 was hired before 2002-06-21, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) 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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) 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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average total hospital cost that includes a procedure called a dx ultrasound-heart until 2103?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dx ultrasound-heart')) AND STRFTIME('%y', cost.chargetime) <= '2103' GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_24099916_1 ( model__list_ VARCHAR, tdp VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the model of the processor with a 5.5 w TDP?
SELECT model__list_ FROM table_24099916_1 WHERE tdp = "5.5 W"
sql_create_context
CREATE TABLE table_name_45 ( rank INTEGER, nation VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of a rank whose nation is West Germany and has bronze larger than 0?
SELECT SUM(rank) FROM table_name_45 WHERE nation = "west germany" AND bronze > 0
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 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 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 ReviewTaskStates ( Id number, Name text, Description text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Answers for a certain tag (by year).
SELECT a.Id AS "post_link", a.Id, q.Title, a.CreationDate, a.Score, q.ViewCount AS "views", CASE WHEN a.Id = q.AcceptedAnswerId THEN 1 ELSE 0 END AS Accepted, q.Tags FROM Posts AS a LEFT JOIN Posts AS q ON q.Id = a.ParentId WHERE a.PostTypeId = 2 AND a.OwnerUserId = '##UserId##' AND q.Tags LIKE '%<##Tag##>%' AND YEAR(a.CreationDate) = '##Year##' ORDER BY a.CreationDate DESC
sede
CREATE TABLE table_70781 ( "Name" text, "Born" text, "Age on mission" real, "Mission" text, "Mission dates" text, "Service" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest age of an astronaut named Stu Roosa?
SELECT MIN("Age on mission") FROM table_70781 WHERE "Name" = 'stu roosa'
wikisql
CREATE TABLE table_name_71 ( leading_lady VARCHAR, studio VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the leading lady for Uni studio and Frank Strayer?
SELECT leading_lady FROM table_name_71 WHERE studio = "uni" AND director = "frank strayer"
sql_create_context
CREATE TABLE table_29822 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the highest assists during game 78?
SELECT "High assists" FROM table_29822 WHERE "Game" = '78'
wikisql
CREATE TABLE table_7315 ( "Tournament" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "Career W-L" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value in 2006 when the value for 2009 is 0 with runner-ups for tournament?
SELECT "2006" FROM table_7315 WHERE "2009" = '0' AND "Tournament" = 'runner-ups'
wikisql
CREATE TABLE table_53707 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which venue did a home team score 15.5 (95)?
SELECT "Venue" FROM table_53707 WHERE "Home team score" = '15.5 (95)'
wikisql
CREATE TABLE team_half ( year number, league_id text, team_id text, half number, div_id text, div_win text, rank number, g number, w number, l number ) CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, tie text, notes text ) CREATE TABLE fielding_postseason ( player_id text, year number, team_id text, league_id text, round text, pos text, g number, gs number, inn_outs number, po number, a number, e number, dp number, tp number, pb number, sb number, cs number ) CREATE TABLE player ( player_id text, birth_year number, birth_month number, birth_day number, birth_country text, birth_state text, birth_city text, death_year number, death_month number, death_day number, death_country text, death_state text, death_city text, name_first text, name_last text, name_given text, weight number, height number, bats text, throws text, debut text, final_game text, retro_id text, bbref_id text ) CREATE TABLE fielding_outfield ( player_id text, year number, stint number, glf number, gcf number, grf number ) CREATE TABLE manager ( player_id text, year number, team_id text, league_id text, inseason number, g number, w number, l number, rank number, plyr_mgr text ) CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots number, needed number, votes number, inducted text, category text, needed_note text ) CREATE TABLE appearances ( year number, team_id text, league_id text, player_id text, g_all number, gs number, g_batting number, g_defense number, g_p number, g_c number, g_1b number, g_2b number, g_3b number, g_ss number, g_lf number, g_cf number, g_rf number, g_of number, g_dh number, g_ph number, g_pr number ) CREATE TABLE batting_postseason ( year number, round text, player_id text, team_id text, league_id text, g number, ab number, r number, h number, double number, triple number, hr number, rbi number, sb number, cs number, bb number, so number, ibb number, hbp number, sh number, sf number, g_idp number ) CREATE TABLE fielding ( player_id text, year number, stint number, team_id text, league_id text, pos text, g number, gs number, inn_outs number, po number, a number, e number, dp number, pb number, wp number, sb number, cs number, zr number ) CREATE TABLE postseason ( year number, round text, team_id_winner text, league_id_winner text, team_id_loser text, league_id_loser text, wins number, losses number, ties number ) CREATE TABLE salary ( year number, team_id text, league_id text, player_id text, salary number ) CREATE TABLE player_college ( player_id text, college_id text, year number ) CREATE TABLE team ( year number, league_id text, team_id text, franchise_id text, div_id text, rank number, g number, ghome number, w number, l number, div_win text, wc_win text, lg_win text, ws_win text, r number, ab number, h number, double number, triple number, hr number, bb number, so number, sb number, cs number, hbp number, sf number, ra number, er number, era number, cg number, sho number, sv number, ipouts number, ha number, hra number, bba number, soa number, e number, dp number, fp number, name text, park text, attendance number, bpf number, ppf number, team_id_br text, team_id_lahman45 text, team_id_retro text ) CREATE TABLE batting ( player_id text, year number, stint number, team_id text, league_id text, g number, ab number, r number, h number, double number, triple number, hr number, rbi number, sb number, cs number, bb number, so number, ibb number, hbp number, sh number, sf number, g_idp number ) CREATE TABLE park ( park_id text, park_name text, park_alias text, city text, state text, country text ) CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first number ) CREATE TABLE pitching ( player_id text, year number, stint number, team_id text, league_id text, w number, l number, g number, gs number, cg number, sho number, sv number, ipouts number, h number, er number, hr number, bb number, so number, baopp number, era number, ibb number, wp number, hbp number, bk number, bfp number, gf number, r number, sh number, sf number, g_idp number ) CREATE TABLE team_franchise ( franchise_id text, franchise_name text, active text, na_assoc text ) CREATE TABLE all_star ( player_id text, year number, game_num number, game_id text, team_id text, league_id text, gp number, starting_pos number ) CREATE TABLE pitching_postseason ( player_id text, year number, round text, team_id text, league_id text, w number, l number, g number, gs number, cg number, sho number, sv number, ipouts number, h number, er number, hr number, bb number, so number, baopp text, era number, ibb number, wp number, hbp number, bk number, bfp number, gf number, r number, sh number, sf number, g_idp number ) CREATE TABLE home_game ( year number, league_id text, team_id text, park_id text, span_first text, span_last text, games number, openings number, attendance number ) CREATE TABLE college ( college_id text, name_full text, city text, state text, country text ) CREATE TABLE manager_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first number ) CREATE TABLE manager_award ( player_id text, award_id text, year number, league_id text, tie text, notes number ) CREATE TABLE manager_half ( player_id text, year number, team_id text, league_id text, inseason number, half number, g number, w number, l number, rank number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Count the number of players who enter hall of fame for each year.
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid
spider
CREATE TABLE table_10 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different nationalities do the players of New Jersey Devils come from?
SELECT COUNT("Nationality") FROM table_10 WHERE "NHL team" = 'New Jersey Devils'
wikisql
CREATE TABLE table_201_42 ( id number, "year" text, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times did daniels host saturday night live ?
SELECT COUNT(*) FROM table_201_42 WHERE "title" = 'saturday night live' AND "role" = 'host'
squall
CREATE TABLE table_23399481_4 ( title VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the episode/s written by Michael Gans & Richard Register?
SELECT title FROM table_23399481_4 WHERE written_by = "Michael Gans & Richard Register"
sql_create_context
CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartment_bookings ( apt_booking_id number, apt_id number, guest_id number, booking_status_code text, booking_start_date time, booking_end_date time ) CREATE TABLE guests ( guest_id number, gender_code text, guest_first_name text, guest_last_name text, date_of_birth time ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, bathroom_count number, bedroom_count number, room_count text ) CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE apartment_buildings ( building_id number, building_short_name text, building_full_name text, building_description text, building_address text, building_manager text, building_phone text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the total number of rooms in the apartments that have facility code 'Gym'.
SELECT SUM(T2.room_count) FROM apartment_facilities AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = "Gym"
spider
CREATE TABLE table_name_6 ( player VARCHAR, team VARCHAR, pick VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Pick smaller than 11, and a Position of rhp, and a Team of new york mets?
SELECT player FROM table_name_6 WHERE pick < 11 AND position = "rhp" AND team = "new york mets"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the item id of patient jerry deberry? also specify his birthdate
SELECT demographic.dob, lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me a list of the names of all songs ordered by their resolution.
SELECT song_name FROM song ORDER BY resolution
spider
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the facility codes of the apartments with more than four bedrooms, and count them by a pie chart
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code
nvbench
CREATE TABLE table_name_66 ( chinese__traditional_ VARCHAR, chinese__simplified_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What would be the traditional Chinese name tat is simplified as ?
SELECT chinese__traditional_ FROM table_name_66 WHERE chinese__simplified_ = "崇拜"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 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. -- how many patients whose diagnoses short title is chr airway obstruct nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Chr airway obstruct NEC"
mimicsql_data
CREATE TABLE table_31418 ( "Official name" text, "INE code" real, "Name in Spanish" text, "Name in Basque" text, "Population (2007)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the official name of the municipality whose name in Spanish is Crip n?
SELECT "Official name" FROM table_31418 WHERE "Name in Spanish" = 'Cripán'
wikisql
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 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 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 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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the monthly maximum urine out foley output that patient 73155 has had since 01/18/2101?
SELECT MAX(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 = 73155)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out foley' AND d_items.linksto = 'outputevents') AND STRFTIME('%y-%m-%d', outputevents.charttime) >= '2101-01-18' GROUP BY STRFTIME('%y-%m', outputevents.charttime)
mimic_iii
CREATE TABLE table_41302 ( "Round #" real, "Pick #" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average round number with wide receiver as position and Clark University as the college and the pick number is bigger than 166?
SELECT AVG("Round #") FROM table_41302 WHERE "Position" = 'wide receiver' AND "College" = 'clark university' AND "Pick #" > '166'
wikisql
CREATE TABLE table_name_24 ( round INTEGER, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round in which a player was picked for the Center position?
SELECT MAX(round) FROM table_name_24 WHERE position = "center"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) 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 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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE month ( month_number int, month_name text ) 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) 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 time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) 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 compartment_class ( compartment varchar, class_type 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 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 time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- okay just on 11 23 i want to fly from ATLANTA to DENVER and i need to know what flights are available
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 23 AND date_day.month_number = 11 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
atis
CREATE TABLE table_11585313_1 ( name VARCHAR, date_of_death† VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the person whose date of death is 01-04-1954?
SELECT name FROM table_11585313_1 WHERE date_of_death† = "01-04-1954"
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 TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) 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 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) 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 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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_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 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 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. -- how many days have it been since the first time during the current hospital encounter that patient 22648 was diagnosed with meth res pneu d/t staph?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'meth res pneu d/t staph') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22648 AND admissions.dischtime IS NULL) ORDER BY diagnoses_icd.charttime LIMIT 1
mimic_iii
CREATE TABLE table_52894 ( "Runner" text, "Country" text, "5K Wins" real, "10K Wins" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many 5K wins did Emily Chebet, who had more than 2 total, have?
SELECT SUM("5K Wins") FROM table_52894 WHERE "Runner" = 'emily chebet' AND "Total" > '2'
wikisql
CREATE TABLE table_59490 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "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 is the League Goals when the FA Cup Goals are 0, position is mf, League Cup Apps of 0, and name is Ben Thornley?
SELECT AVG("League Goals") FROM table_59490 WHERE "FA Cup Goals" = '0' AND "Position" = 'mf' AND "League Cup Apps" = '0' AND "Name" = 'ben thornley'
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 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 ) 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many patients aged below 45 years with a diagnosis short title poison-analgesics?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "45" AND diagnoses.short_title = "Poison-analgesics"
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 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 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. -- Count the number of patients who were admitted before the year 2176 and have procedure long title as coronary arteriography using a single catheter.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2176" AND procedures.long_title = "Coronary arteriography using a single catheter"
mimicsql_data
CREATE TABLE table_name_12 ( genre VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Genre for Malina (ger.-aus.-fr.), an Original Title?
SELECT genre FROM table_name_12 WHERE original_title = "malina (ger.-aus.-fr.)"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) 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 state ( state_code text, state_name text, country_name text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight 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 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 food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE days ( days_code varchar, day_name 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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- find a flight from BOSTON to WASHINGTON on monday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
atis
CREATE TABLE table_name_1 ( engine VARCHAR, rounds VARCHAR, driver VARCHAR, tyres VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine was used during the race driven by Jan Lammers using a chassis of d3 d4, making a tyre of g and rounds of 4-6?
SELECT engine FROM table_name_1 WHERE tyres = "g" AND chassis = "d3 d4" AND driver = "jan lammers" AND rounds = "4-6"
sql_create_context
CREATE TABLE table_name_48 ( no_vote VARCHAR, state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many no votes did North Dakota have?
SELECT no_vote FROM table_name_48 WHERE state = "north dakota"
sql_create_context
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 zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC 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 ) 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. -- 名叫袁秀筠的患者检测指标634250从09年10月15日到14年10月24日的情况如何?
SELECT * 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE person_info.XM = '袁秀筠' AND jyjgzbb.JYRQ BETWEEN '2009-10-15' AND '2014-10-24' AND jyjgzbb.JCZBDM = '634250' UNION SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN jyjgzbb JOIN zyjzjlb_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 = zyjzjlb_jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND zyjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND zyjzjlb_jybgb.BGDH = jybgb.BGDH AND zyjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND zyjzjlb_jybgb.BGDH = jybgb.BGDH WHERE person_info.XM = '袁秀筠' AND jyjgzbb.JYRQ BETWEEN '2009-10-15' AND '2014-10-24' AND jyjgzbb.JCZBDM = '634250'
css
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) 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 Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give the proportion of how many male and female assistant professors do we have?
SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex
nvbench
CREATE TABLE table_name_45 ( losses VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Losses have a Name of blair kiel?
SELECT COUNT(losses) FROM table_name_45 WHERE name = "blair kiel"
sql_create_context
CREATE TABLE table_name_54 ( losses VARCHAR, byes INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Of the teams that had more than 0 byes, what was the total number of losses?
SELECT COUNT(losses) FROM table_name_54 WHERE byes < 0
sql_create_context
CREATE TABLE table_203_701 ( id number, "#" number, "title" text, "featured guest(s)" text, "producer(s)" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many titles are on the album ?
SELECT COUNT("title") FROM table_203_701
squall
CREATE TABLE table_45747 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance when the score was 88-98?
SELECT "Attendance" FROM table_45747 WHERE "Score" = '88-98'
wikisql
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) 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 ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 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 CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Number of active experts per week (courtesy of Isaac Moses).
SELECT YR_WK, COUNT(*) AS NumActiveExperts FROM (SELECT (TIME_TO_STR(p.CreationDate, '%y') + (TIME_TO_STR(p.CreationDate, '%W') - 1) / 52.0) AS YR_WK, u.Id AS UID, COUNT(*) AS NumAnswers FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id AND p.PostTypeId = 2 AND p.Score > 0 GROUP BY (TIME_TO_STR(p.CreationDate, '%y') + (TIME_TO_STR(p.CreationDate, '%W') - 1) / 52.0), u.Id) AS AnsPerUPerWk WHERE NumAnswers > 1 GROUP BY YR_WK ORDER BY YR_WK
sede
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) 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 date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description 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 state ( state_code text, state_name text, country_name text ) 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 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 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 time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) 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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- list flights from NEW YORK to LOS ANGELES
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
atis
CREATE TABLE table_70000 ( "Tournament" text, "Wins" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest number of cuts made while the win was less than 0?
SELECT MIN("Cuts made") FROM table_70000 WHERE "Wins" < '0'
wikisql
CREATE TABLE table_9627 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par for Leonard Thompson from the United States with a place of T6?
SELECT "To par" FROM table_9627 WHERE "Place" = 't6' AND "Country" = 'united states' AND "Player" = 'leonard thompson'
wikisql
CREATE TABLE table_74154 ( "Product Name" text, "Form Factor" text, "Storage Medium" text, "Max Usable Capacity (GB)" real, "Speed ( IOPS )" real, "Latency (microseconds)" real, "Bandwidth (GB/s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the range distroration for the ramsan-630
SELECT "Form Factor" FROM table_74154 WHERE "Product Name" = 'RamSan-630'
wikisql
CREATE TABLE table_name_8 ( launches_to_date VARCHAR, version VARCHAR, ccbs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total Launches to date with a Version of 541, and CCBs smaller than 1?
SELECT COUNT(launches_to_date) FROM table_name_8 WHERE version = "541" AND ccbs < 1
sql_create_context
CREATE TABLE table_14342367_13 ( class VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was George W. Gregory's class?
SELECT class FROM table_14342367_13 WHERE player = "George W. Gregory"
sql_create_context
CREATE TABLE table_name_77 ( pick__number INTEGER, round VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the pick numbers where the player was picked in round 5 and overall pick number was greater than 159?
SELECT SUM(pick__number) FROM table_name_77 WHERE round = 5 AND overall > 159
sql_create_context
CREATE TABLE table_38611 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "TV Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game Site has a Date of october 17, 1999?
SELECT "Game Site" FROM table_38611 WHERE "Date" = 'october 17, 1999'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, 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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many male patients are less than 79 years of age?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "79"
mimicsql_data
CREATE TABLE table_72607 ( "Episode #" text, "Country" text, "City" text, "Martial Art/Style" text, "Masters" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many masters fought using a boxing style?
SELECT COUNT("Masters") FROM table_72607 WHERE "Martial Art/Style" = 'Boxing'
wikisql
CREATE TABLE table_62684 ( "Main contestant" text, "Co-contestant (Yaar vs. Pyaar)" text, "Date performed" text, "Scores by each individual judge" text, "Total score/week" text, "Position" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position is there when the main contestant is Vishal Singh and the scores are 1 + 7 + 5 = 13?
SELECT "Position" FROM table_62684 WHERE "Main contestant" = 'vishal singh' AND "Scores by each individual judge" = '1 + 7 + 5 = 13'
wikisql