instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_71763 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the qual with 200 laps and a rank of 27?
SELECT "Qual" FROM table_71763 WHERE "Laps" = '200' AND "Rank" = '27'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication (...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-13643')) AND medication.drugname = 'albumin human 25%' AND DATETIME(me...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT demographic.age FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE table_name_38 ( location VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Dynamo-2 located?
SELECT location FROM table_name_38 WHERE team = "dynamo-2"
sql_create_context
CREATE TABLE table_38525 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Gold that has a Rank of 6, and a Bronze larger than 0 had what total number of gold?
SELECT COUNT("Gold") FROM table_38525 WHERE "Rank" = '6' AND "Bronze" > '0'
wikisql
CREATE TABLE table_16376436_1 ( college VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college did the defensive back attend?
SELECT college FROM table_16376436_1 WHERE position = "Defensive Back"
sql_create_context
CREATE TABLE Ref_document_types ( document_type_name VARCHAR, document_type_description VARCHAR, document_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name and description for document type code RV?
SELECT document_type_name, document_type_description FROM Ref_document_types WHERE document_type_code = "RV"
sql_create_context
CREATE TABLE table_174266_6 ( one_year INTEGER, two_years VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If two years is 159, what is the amount for one year?
SELECT MIN(one_year) FROM table_174266_6 WHERE two_years = 159
sql_create_context
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Type, COUNT(*) FROM ship GROUP BY Type
nvbench
CREATE TABLE table_name_90 ( date VARCHAR, week VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the attendance less than 44,851 during the first 4 weeks of the season?
SELECT date FROM table_name_90 WHERE week < 4 AND attendance = "44,851"
sql_create_context
CREATE TABLE table_204_129 ( id number, "place" number, "team" text, "titles" number, "runners-up" number, "winning years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many teams won at least 1 title ?
SELECT COUNT("team") FROM table_204_129 WHERE "titles" >= 1
squall
CREATE TABLE table_43097 ( "Week" real, "Date" text, "Opponent" text, "Time" text, "Game Site" text, "Result/Score" text, "Record" text, "Match Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which match report has l 7-30 as the r...
SELECT "Match Report" FROM table_43097 WHERE "Result/Score" = 'l 7-30'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Sepsis" AND prescriptions.route = "ED"
mimicsql_data
CREATE TABLE table_name_40 ( kicks VARCHAR, goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the kicks with goals of 1
SELECT kicks FROM table_name_40 WHERE goals = "1"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.dob_year < "2064"
mimicsql_data
CREATE TABLE table_name_49 ( to_par VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par for japan
SELECT to_par FROM table_name_49 WHERE country = "japan"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT p.OwnerUserId, u.DisplayName, AVG(LENGTH(p.Body)) AS AvgLen FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE u.Reputation >= 10000 GROUP BY p.OwnerUserId, u.DisplayName ORDER BY AvgLen DESC
sede
CREATE TABLE MediaType ( MediaTypeId integer, Name varchar(120) ) CREATE TABLE Genre ( GenreId integer, Name varchar(120) ) CREATE TABLE Playlist ( PlaylistId integer, Name varchar(120) ) CREATE TABLE Customer ( CustomerId integer, FirstName varchar(40), LastName varchar(20), ...
SELECT InvoiceDate, COUNT(InvoiceDate) FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber" ORDER BY COUNT(InvoiceDate) DESC
nvbench
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Co...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements ORDER BY COUNT(Date_Claim_Made)
nvbench
CREATE TABLE claim_headers ( claim_header_id number, claim_status_code text, claim_type_code text, policy_id number, date_of_claim time, date_of_settlement time, amount_claimed number, amount_piad number ) CREATE TABLE staff ( staff_id number, staff_details text ) CREATE TABLE ...
SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_24775967_1 ( notability_profession VARCHAR, season VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the profession of the celebrity who was featured on season 15 and finished 7th place?
SELECT notability_profession FROM table_24775967_1 WHERE season = 15 AND finish = "7th"
sql_create_context
CREATE TABLE table_7146 ( "Year" real, "Artist" text, "Album" text, "Label" text, "Credit" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What album had the reunion label in 2006?
SELECT "Album" FROM table_7146 WHERE "Label" = 'reunion' AND "Year" = '2006'
wikisql
CREATE TABLE table_name_15 ( week_7_oct_12 VARCHAR, week_11_nov_9 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week 7 Oct 12 has a Week 11 Nov 9 of week 11 nov 9?
SELECT week_7_oct_12 FROM table_name_15 WHERE week_11_nov_9 = "week 11 nov 9"
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 lab ( subject_id text, hadm_id text, ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION" AND demographic.dod_year < "2158.0"
mimicsql_data
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 prescriptions ( row_id number, subject_id number, h...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929 AND admissions.dischtime IS NULL) AND prescriptions.route = 'po/ng' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_85 ( home VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team that played the Lakers?
SELECT home FROM table_name_85 WHERE visitor = "lakers"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 TABL...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_31029 ( "Song 1 title" text, "Artist 1" text, "Song 2 title" text, "Artist 2" text, "Mix artist" text, "Venue" text, "Battle Mix?" text, "Setlist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the artist 2 on t...
SELECT "Artist 2" FROM table_31029 WHERE "Artist 1" = 'Sparfunk & D-Code'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24118 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime...
mimic_iii
CREATE TABLE table_name_44 ( year INTEGER, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year of a film from Mexico?
SELECT MIN(year) FROM table_name_44 WHERE country = "mexico"
sql_create_context
CREATE TABLE table_203_499 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average score of the players from the united states ...
SELECT AVG("score") FROM table_203_499 WHERE "country" = 'united states'
squall
CREATE TABLE table_name_68 ( player VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player is from Tampa, Florida?
SELECT player FROM table_name_68 WHERE hometown = "tampa, florida"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "SEPSIS"
mimicsql_data
CREATE TABLE person ( name text, age number, city text, gender text, job text ) CREATE TABLE personfriend ( name text, friend text, year number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of the people who are older 40 ...
SELECT T1.name FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM person WHERE age > 40) EXCEPT SELECT T1.name FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM person WHERE age < 30)
spider
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT DIRE_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '60994450821' AND SOC_SRT_DIRE_NM = '富马酸喹硫平片(薄膜)'
css
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, OwnerU...
SELECT p.ViewCount, p.Id AS "Post Id", p.Title, p.AnswerCount FROM Posts AS p WHERE p.PostTypeId = 1 AND p.AcceptedAnswerId IS NULL AND p.ClosedDate IS NULL AND p.CommunityOwnedDate IS NULL AND p.AnswerCount = 0 ORDER BY p.ViewCount DESC LIMIT 100
sede
CREATE TABLE table_name_65 ( term_in_office VARCHAR, electorate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which term in office has an Electorate of hinkler?
SELECT term_in_office FROM table_name_65 WHERE electorate = "hinkler"
sql_create_context
CREATE TABLE table_name_40 ( date_of_appointment VARCHAR, date_of_vacancy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the appointment day for 4 December 2008 vacancy?
SELECT date_of_appointment FROM table_name_40 WHERE date_of_vacancy = "4 december 2008"
sql_create_context
CREATE TABLE table_50081 ( "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Lane, when Mark is 7.66?
SELECT MIN("Lane") FROM table_50081 WHERE "Mark" = '7.66'
wikisql
CREATE TABLE table_17335602_1 ( winning_score VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many winning scores were there in the rr donnelley lpga founders cup?
SELECT COUNT(winning_score) FROM table_17335602_1 WHERE tournament = "RR Donnelley LPGA Founders Cup"
sql_create_context
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2151-12-28 15:30:00"
mimicsql_data
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE ground...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
atis
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname 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, ...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '1:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'MILSCI' AND course.numb...
advising
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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 te...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '蒋夏彤' AND jybg...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status autm crd dfbrltr" AND prescriptions.route = "IM"
mimicsql_data
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '小儿放射治疗科' AND t_kc21.IN_HOSP_DATE BETWEEN '2009-06-24' AND '2018-07-12' AND t_kc21.IN_DIAG_DIS_NM = '白内障' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '43810325' AND hz_info.YLJGDM = '0319489' AND NOT zyjzjlb.CYKSMC LIKE '%关节%'
css
CREATE TABLE table_name_31 ( team VARCHAR, league VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has a national league in 2001?
SELECT team FROM table_name_31 WHERE league = "national" AND year = 2001
sql_create_context
CREATE TABLE table_2665085_1 ( name VARCHAR, park VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many parks are called mt. olympus
SELECT COUNT(name) FROM table_2665085_1 WHERE park = "Mt. Olympus"
sql_create_context
CREATE TABLE table_2508633_9 ( player VARCHAR, nfl_team VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players were the running back draft pick for the New England Patriots?
SELECT COUNT(player) FROM table_2508633_9 WHERE nfl_team = "New England Patriots" AND position = "Running back"
sql_create_context
CREATE TABLE table_40079 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "Pictorials" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Centerfold model in the issue in which the Interview subject was P...
SELECT "Centerfold model" FROM table_40079 WHERE "Interview subject" = 'paul simon'
wikisql
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, ...
SELECT MAX(inputevents_cv.amount) 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 = 3677)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe...
mimic_iii
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 ReviewTaskResults ( Id number, Review...
SELECT YearBadges.Y, CAST(NumQuestions AS FLOAT) / CAST(BadgeScore AS FLOAT) AS Ratio FROM (SELECT SUM(CASE B.Class WHEN 1 THEN 10 WHEN 2 THEN 4 WHEN 3 THEN 1 END) AS BadgeScore, YEAR(Date) AS Y FROM Badges AS B WHERE B.TagBased = 1 AND B.Name = '##TagName##' AND YEAR(B.Date) < 2017 AND YEAR(B.Date) > 2008 GROUP BY YEA...
sede
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additio...
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
advising
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 program_requirement ( program_id int...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id...
advising
CREATE TABLE table_61508 ( "Date" text, "Opponent" text, "Site" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Opponent has a Site of razorback stadium fayetteville, ar, and a Date of october 7, 1967?
SELECT "Opponent" FROM table_61508 WHERE "Site" = 'razorback stadium • fayetteville, ar' AND "Date" = 'october 7, 1967'
wikisql
CREATE TABLE table_7267 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the To par when the Score was 67-68=135?
SELECT "To par" FROM table_7267 WHERE "Score" = '67-68=135'
wikisql
CREATE TABLE table_40525 ( "Match No." text, "Home Team" text, "Score" text, "Away Team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of match 15?
SELECT "Score" FROM table_40525 WHERE "Match No." = '15'
wikisql
CREATE TABLE table_name_60 ( d_45_o VARCHAR, d_41_√ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value of D 45 O, when the value of D 41 is r 41 ?
SELECT d_45_o FROM table_name_60 WHERE d_41_√ = "r 41 √"
sql_create_context
CREATE TABLE table_204_152 ( id number, "device" text, "type" text, "iops" text, "interface" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the only device to have the flash memory array note ?
SELECT "device" FROM table_204_152 WHERE "notes" = 'flash memory array'
squall
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700 DESC
nvbench
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND...
css
CREATE TABLE table_18595004_7 ( tonioli VARCHAR, week__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many sets of marks does Tonioli get in week 3?
SELECT COUNT(tonioli) FROM table_18595004_7 WHERE week__number = 3
sql_create_context
CREATE TABLE table_name_37 ( norwegian_title VARCHAR, pages VARCHAR, translated_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Norwegian title has 218 pages and Translated Title of Breaking Dawn?
SELECT norwegian_title FROM table_name_37 WHERE pages = 218 AND translated_title = "breaking dawn"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT COUNT(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_ID = '95900132' AND IN_HOSP_DATE BETWEEN '2002-01-04' AND '2014-09-24'
css
CREATE TABLE table_28719193_19 ( date VARCHAR, matchups_results VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game that had a result of Army 16, SMU 14?
SELECT date FROM table_28719193_19 WHERE matchups_results = "Army 16, SMU 14"
sql_create_context
CREATE TABLE table_3769 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the latest...
SELECT MAX("No. in series") FROM table_3769 WHERE "Directed by" = 'Skip Sudduth'
wikisql
CREATE TABLE table_55576 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the home team in the match...
SELECT "Home team score" FROM table_55576 WHERE "Venue" = 'western oval'
wikisql
CREATE TABLE table_16636344_1 ( league VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team's league in 2010?
SELECT league FROM table_16636344_1 WHERE year = "2010"
sql_create_context
CREATE TABLE table_37375 ( "Position" text, "Number" real, "Name" text, "Height" text, "Weight" real, "Class" text, "Hometown" text, "Games\u2191" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games has number 61 played in?
SELECT MIN("Games\u2191") FROM table_37375 WHERE "Number" = '61'
wikisql
CREATE TABLE table_21091157_1 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of date for 1-0 record
SELECT COUNT(date) FROM table_21091157_1 WHERE record = "1-0"
sql_create_context
CREATE TABLE table_name_86 ( territory VARCHAR, channel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is channel 83 broadcasted?
SELECT territory FROM table_name_86 WHERE channel = 83
sql_create_context
CREATE TABLE table_name_43 ( date VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Date of Week 16?
SELECT date FROM table_name_43 WHERE week = 16
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME ORDER BY COUNT(COUNTRY_NAME) DESC
nvbench
CREATE TABLE table_name_89 ( end_of_term VARCHAR, age_at_inauguration VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the End of term of the President with an Age at inauguration of 78years, 160days?
SELECT end_of_term FROM table_name_89 WHERE age_at_inauguration = "78years, 160days"
sql_create_context
CREATE TABLE table_39817 ( "Date" text, "Opponent" text, "Location" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Attendance at a game with a Result of w 30-23?
SELECT AVG("Attendance") FROM table_39817 WHERE "Result" = 'w 30-23'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepi...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-20829') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-3 year')
eicu
CREATE TABLE table_name_14 ( the_tradition VARCHAR, year VARCHAR, senior_players_championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Mark O'meara was the senior player champion in a year greater than 1998, who was the tradition?
SELECT the_tradition FROM table_name_14 WHERE year > 1998 AND senior_players_championship = "mark o'meara"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "74" AND procedures.short_title = "Form cutan ileoureterost"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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(4...
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
nvbench
CREATE TABLE table_36822 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which competition in Budapest, Hungary gave a result of 8th?
SELECT "Competition" FROM table_36822 WHERE "Position" = '8th' AND "Venue" = 'budapest, hungary'
wikisql
CREATE TABLE table_36240 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 2000" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position in 2000 has a Capacity larger than 10,080, and a Venue of central, rechytsa?
SELECT "Position in 2000" FROM table_36240 WHERE "Capacity" > '10,080' AND "Venue" = 'central, rechytsa'
wikisql
CREATE TABLE table_name_78 ( time VARCHAR, distance VARCHAR, start_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the finishing time of the Stage that featured a distance of 24.00km and a start time of 21:27?
SELECT time FROM table_name_78 WHERE distance = "24.00km" AND start_time = "21:27"
sql_create_context
CREATE TABLE table_name_83 ( label VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What label released a record on December 19, 2001?
SELECT label FROM table_name_83 WHERE date = "december 19, 2001"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j...
css
CREATE TABLE table_name_30 ( year__ceremony_ VARCHAR, result VARCHAR, actor_actress VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was holly hunter a nominee?
SELECT year__ceremony_ FROM table_name_30 WHERE result = "nominee" AND actor_actress = "holly hunter"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE table_203_636 ( id number, "#" number, "date" text, "winner" text, "score" text, "location" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- at which location has the east west game been played the most ?
SELECT "location" FROM table_203_636 GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_1341586_19 ( result VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the result with candidates being billy tauzin (d) unopposed
SELECT result FROM table_1341586_19 WHERE candidates = "Billy Tauzin (D) Unopposed"
sql_create_context
CREATE TABLE table_67667 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times has the Cornwall HC team, that has scored m...
SELECT COUNT("Losses") FROM table_67667 WHERE "Team" = 'cornwall hc' AND "Goals For" > '18'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) 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, tes...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'WN' AND semester.year = 2017)) AND course.course_id = course_offering.course_id AND course.department = 'department0...
advising
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Tags ( Id num...
SELECT YEAR(p.CreationDate) AS Year, COUNT(CASE WHEN PostTypeId = 1 THEN p.Id ELSE NULL END) AS Questions, COUNT(CASE WHEN PostTypeId = 2 THEN p.Id ELSE NULL END) AS Answers FROM Posts AS p WHERE PostTypeId IN (1, 2) GROUP BY YEAR(p.CreationDate)
sede
CREATE TABLE table_1342233_24 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which district is jamie l. whitten from?
SELECT district FROM table_1342233_24 WHERE incumbent = "Jamie L. Whitten"
sql_create_context
CREATE TABLE table_37506 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of years that have divisions greater than 4?
SELECT COUNT("Year") FROM table_37506 WHERE "Division" > '4'
wikisql
CREATE TABLE table_65596 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has rank 5?
SELECT "Name" FROM table_65596 WHERE "Rank" = '5'
wikisql
CREATE TABLE table_28243323_1 ( club_name VARCHAR, writer_composer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team that has a song writer named larry spokes.
SELECT club_name FROM table_28243323_1 WHERE writer_composer = "Larry Spokes"
sql_create_context
CREATE TABLE table_46933 ( "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 country that the player is from with +3 to par and score of 74-73=147?
SELECT "Country" FROM table_46933 WHERE "To par" = '+3' AND "Score" = '74-73=147'
wikisql
CREATE TABLE table_name_55 ( declination___j2000__ VARCHAR, right_ascension___j2000__ VARCHAR, constellation VARCHAR, apparent_magnitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the declination for consellaion of ophiuchus and apparent ...
SELECT declination___j2000__ FROM table_name_55 WHERE constellation = "ophiuchus" AND apparent_magnitude < 8.6 AND right_ascension___j2000__ = "16h47m14.5s"
sql_create_context