instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT demographic.gender FROM demographic WHERE demographic.name = "Estrella Carroll"
mimicsql_data
CREATE TABLE table_30685 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date of the episode ...
SELECT "Original air date" FROM table_30685 WHERE "U.S. viewers (million)" = '0.88'
wikisql
CREATE TABLE table_2679061_4 ( pick__number VARCHAR, college_junior_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number pick was the player from HIFK Helsinki (Finland)?
SELECT pick__number FROM table_2679061_4 WHERE college_junior_club_team = "HIFK Helsinki (Finland)"
sql_create_context
CREATE TABLE STUDENT ( Fname VARCHAR, LName VARCHAR, StuID VARCHAR ) CREATE TABLE ENROLLED_IN ( Grade VARCHAR, StuID VARCHAR ) CREATE TABLE GRADECONVERSION ( gradepoint VARCHAR, lettergrade VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT T3.Fname, T3.LName, T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID
sql_create_context
CREATE TABLE table_name_28 ( winner_and_score VARCHAR, finalist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the winner and score for finalist s bastien grosjean?
SELECT winner_and_score FROM table_name_28 WHERE finalist = "sébastien grosjean"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description va...
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0...
advising
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '孙虹影' AND qtb.MED_SER_ORG_NO = '3151160' AND NOT qtb.IN_DIAG_DIS_NM LIKE '%牙体%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '孙虹影' AND gyb.MED_SER_ORG_NO = '3151160' AND NOT gyb.IN_DIAG_DIS_NM LIKE '%牙体%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb WH...
css
CREATE TABLE table_204_68 ( id number, "name" text, "profession" text, "hometown" text, "term expires" number, "office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which state regent 's term will last the longest ?
SELECT "name" FROM table_204_68 ORDER BY "term expires" DESC LIMIT 1
squall
CREATE TABLE table_name_61 ( director_s_ VARCHAR, writer_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What director worked with Al Mackay as writer?
SELECT director_s_ FROM table_name_61 WHERE writer_s_ = "al mackay"
sql_create_context
CREATE TABLE table_44520 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Nationality, when Player is 'Andrew Campbell'?
SELECT "Nationality" FROM table_44520 WHERE "Player" = 'andrew campbell'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT * FROM Posts
sede
CREATE TABLE table_80349 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the rank for 151 Laps
SELECT "Rank" FROM table_80349 WHERE "Laps" = '151'
wikisql
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 DISTINCT p.Id AS "post_link", p.CreationDate AS "date" FROM Posts AS p INNER JOIN Posts AS q ON q.Id = COALESCE(p.ParentId, p.Id) INNER JOIN PostTypes AS pt ON pt.Id = p.PostTypeId INNER JOIN PostTags AS pta ON pta.PostId = q.Id INNER JOIN Tags AS ta ON ta.Id = pta.TagId INNER JOIN PostTags AS pto ON pto.PostId ...
sede
CREATE TABLE table_19604 ( "Year" real, "Tournaments played" real, "Cuts made" real, "Wins" real, "2nd" real, "3rd" real, "Top 10s" real, "Best finish" text, "Earnings ( $ )" real, "Money list rank" text, "Scoring average" text, "Scoring rank" text ) -- Using valid SQLi...
SELECT MIN("Cuts made") FROM table_19604 WHERE "Best finish" = 'T4'
wikisql
CREATE TABLE table_7815 ( "Tournament" text, "Wins" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of events with 24 cuts and less than 11 in the top-25?
SELECT MIN("Events") FROM table_7815 WHERE "Cuts made" = '24' AND "Top-25" < '11'
wikisql
CREATE TABLE table_13074 ( "Helium" text, "Neon" text, "Argon" text, "Krypton" text, "Xenon" text, "Radon" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What neon has an Argon of 4.203?
SELECT "Neon" FROM table_13074 WHERE "Argon" = '4.203'
wikisql
CREATE TABLE table_204_185 ( id number, "location" text, "town" text, "output (mw ac)" number, "modules" number, "number of arrays" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which project location has the lowest outupt ?
SELECT "location" FROM table_204_185 ORDER BY "output (mw ac)" LIMIT 1
squall
CREATE TABLE table_22373 ( "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. -- How many viewers watched the 16mm t/r episode?
SELECT "Viewers (in millions)" FROM table_22373 WHERE "Archive" = '16mm t/r'
wikisql
CREATE TABLE table_204_230 ( id number, "team #1" text, "agg." text, "team #2" text, "1st match" text, "2nd match" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which was the only team to score 5 points in the 1st match ?
SELECT "team #1" FROM table_204_230 WHERE "1st match" = 5
squall
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGE...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name
nvbench
CREATE TABLE table_66037 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the game that has tie no 2?
SELECT "Date" FROM table_66037 WHERE "Tie no" = '2'
wikisql
CREATE TABLE table_17102076_5 ( high_rebounds VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the high rebounds for game 11
SELECT high_rebounds FROM table_17102076_5 WHERE game = 11
sql_create_context
CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE market ( Market_ID int, Country text, Number_cities int ) CREATE TABLE film ( Film_ID int, Title text, Stud...
SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_46 ( goals INTEGER, tries VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of goals from 24 tries and 96 or greater points?
SELECT SUM(goals) FROM table_name_46 WHERE tries = 24 AND points > 96
sql_create_context
CREATE TABLE track ( name VARCHAR, track_id VARCHAR ) CREATE TABLE race ( track_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the name of track with most number of races.
SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_23284597_3 ( year VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the year for guillermo ca as
SELECT year FROM table_23284597_3 WHERE opponent_in_the_final = "Guillermo Cañas"
sql_create_context
CREATE TABLE table_39712 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years have a position of 2nd?
SELECT COUNT("Year") FROM table_39712 WHERE "Position" = '2nd'
wikisql
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) -- Using valid SQLite, answer the following que...
SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee ORDER BY Nominee
nvbench
CREATE TABLE table_1342292_45 ( party VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many incumbents were first elected in 1930?
SELECT COUNT(party) FROM table_1342292_45 WHERE first_elected = 1930
sql_create_context
CREATE TABLE table_48961 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team was the away team when the home team was Hereford United?
SELECT "Away team" FROM table_48961 WHERE "Home team" = 'hereford united'
wikisql
CREATE TABLE table_name_5 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team at punt road oval?
SELECT away_team FROM table_name_5 WHERE venue = "punt road oval"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND demographic.age < "54"
mimicsql_data
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
nvbench
CREATE TABLE table_27426 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the year 2013, what was the outcome?
SELECT "Outcome" FROM table_27426 WHERE "Year" = '2013'
wikisql
CREATE TABLE table_27435931_1 ( elevation_ft VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is elevation of tanzania?
SELECT COUNT(elevation_ft) FROM table_27435931_1 WHERE country = "Tanzania"
sql_create_context
CREATE TABLE airports ( name VARCHAR, elevation INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of airports whose altitude is between -50 and 50.
SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TAB...
SELECT DISTINCT Title, Body FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE t.TagName IN ('machine-learning')
sede
CREATE TABLE table_39954 ( "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of wins against the smaller score 1148?
SELECT SUM("Wins") FROM table_39954 WHERE "Against" < '1148'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABL...
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 575 AND course_offering.semester = semester.semester_id AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM semeste...
advising
CREATE TABLE table_name_18 ( college VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is College, when Pick is 20?
SELECT college FROM table_name_18 WHERE pick = 20
sql_create_context
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state ...
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal DESC
nvbench
CREATE TABLE courses ( course_id text, course_name text, course_description text, other_details text ) CREATE TABLE candidates ( candidate_id number, candidate_details text ) CREATE TABLE people_addresses ( person_address_id number, person_id number, address_id number, date_fro...
SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_36856 ( "City" text, "State/Territory" text, "IATA" text, "ICAO" text, "Airport" text, "Begin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IATA that has new south wales as the state/territory beginning on july 2...
SELECT "IATA" FROM table_36856 WHERE "State/Territory" = 'new south wales' AND "Begin" = 'july 2009'
wikisql
CREATE TABLE table_1139835_1 ( venue VARCHAR, scores VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the venue where the scores are 15.13 (103) 8.4 (52)?
SELECT venue FROM table_1139835_1 WHERE scores = "15.13 (103) – 8.4 (52)"
sql_create_context
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Percu endosc jejunostomy"
mimicsql_data
CREATE TABLE table_26927 ( "Player" text, "Played" real, "Sets Won" real, "Sets Lost" real, "Legs Won" real, "Legs Lost" real, "LWAT" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" text ) -- Using valid SQLite, answer the following q...
SELECT MAX("Sets Lost") FROM table_26927 WHERE "3-dart Average" = '87.55'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int...
SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Mini Classical Civilization%' AND NOT instructor.name LIKE '%Gone%' AND offering_instructor.instructor_id...
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id numbe...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 9038 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_32902 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Young rider classification" text, "Team classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a Team classific...
SELECT "Winner" FROM table_32902 WHERE "Team classification" = 'la vie claire' AND "General classification" = 'greg lemond' AND "Stage" = '20'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT demographic.admission_type, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "26285"
mimicsql_data
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_65859 ( "Year" real, "Category" text, "Recipients and nominees" text, "Role/Episode" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the earliest year when the result is won and the role/episode is fox mulder...
SELECT MIN("Year") FROM table_65859 WHERE "Result" = 'won' AND "Role/Episode" = 'fox mulder'
wikisql
CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, baseprice number, decor text ) CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults...
SELECT SUM(maxoccupancy) FROM rooms WHERE decor = 'modern'
spider
CREATE TABLE table_79957 ( "Year built" text, "Builder" text, "Model" text, "Fleet ID" text, "Seats" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which model has 175 seats?
SELECT "Model" FROM table_79957 WHERE "Seats" = '175'
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 te...
SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.subject_id = "18112"
mimicsql_data
CREATE TABLE table_name_31 ( notes VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the notes of the United States?
SELECT notes FROM table_name_31 WHERE country = "united states"
sql_create_context
CREATE TABLE table_48523 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position has an Overall smaller than 64, and a Round of 1?
SELECT "Position" FROM table_48523 WHERE "Overall" < '64' AND "Round" = '1'
wikisql
CREATE TABLE table_52309 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average frequency MHz for license of eastville, virginia...
SELECT AVG("Frequency MHz") FROM table_52309 WHERE "City of license" = 'eastville, virginia'
wikisql
CREATE TABLE table_77556 ( "Draw" real, "Artist" text, "Song" text, "Place" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Draw when the Place is larger than 5?
SELECT AVG("Draw") FROM table_77556 WHERE "Place" > '5'
wikisql
CREATE TABLE table_name_34 ( airdate VARCHAR, episode_no VARCHAR, bbc_one_weekly_ranking VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the air-dates of the episodes before episode 4 that had a BBC One weekly ranking of 6?
SELECT airdate FROM table_name_34 WHERE episode_no < 4 AND bbc_one_weekly_ranking = 6
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description ...
SELECT Id, AcceptedAnswerId, Tags, Title, Body FROM Posts WHERE Tags LIKE '%google-bigquery%' AND NOT Tags LIKE '%python-2.%' AND CreationDate BETWEEN '2018-01-01 07:37:41' AND '2020-01-25 06:37:41' AND NOT AcceptedAnswerId IS NULL AND DeletionDate IS NULL
sede
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "1 int mam-cor art bypass"
mimicsql_data
CREATE TABLE table_528 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the branding in Dagupan?
SELECT "Branding" FROM table_528 WHERE "Location" = 'Dagupan'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_...
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 = 'PITTSBURGH' AND date_day.day_number = 20 AND date_day.month_number = 1 AN...
atis
CREATE TABLE table_17827271_1 ( roleplay VARCHAR, flatspin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many RolePlay actors played the same role as FlatSpin's Tracy Taylor?
SELECT COUNT(roleplay) FROM table_17827271_1 WHERE flatspin = "Tracy Taylor"
sql_create_context
CREATE TABLE table_61189 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the tie no was 13?
SELECT "Score" FROM table_61189 WHERE "Tie no" = '13'
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 WHERE demographic.language = "ENGL" AND demographic.age < "31"
mimicsql_data
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
nvbench
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name
nvbench
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_fare ( flight_id int, fare_id int ) CREATE TABLE aircraft ( aircraft_code varc...
SELECT DISTINCT flight.departure_time 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
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, d...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4469) AND prescriptions.drug = 'furosemide' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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...
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'mv traff acc-anim rider' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'mv traff acc-anim rider'
mimic_iii
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_icd_procedures ( ...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'lung contusion-open')) GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_68067 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race did Meo Constantini win at the circuit of monza ?
SELECT "Name" FROM table_68067 WHERE "Winning driver" = 'meo constantini' AND "Circuit" = 'monza'
wikisql
CREATE TABLE table_80195 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ICAO of Lohausen airport?
SELECT "ICAO" FROM table_80195 WHERE "Airport" = 'lohausen airport'
wikisql
CREATE TABLE table_204_95 ( id number, "name" text, "title" text, "first year\nin this position" number, "years at nebraska" text, "alma mater" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many coaches have nebraska as their alma mater ?
SELECT COUNT("name") FROM table_204_95 WHERE "alma mater" = 'nebraska'
squall
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_M...
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '70036607501') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '70036607501') AND JCZBJGDL = (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '70036607501')
css
CREATE TABLE table_45608 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which grid did less than 20 laps in a time of +58.353?
SELECT MIN("Grid") FROM table_45608 WHERE "Time" = '+58.353' AND "Laps" < '20'
wikisql
CREATE TABLE table_name_21 ( winning_score VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Winning score when the To par was 21?
SELECT winning_score FROM table_name_21 WHERE to_par = "−21"
sql_create_context
CREATE TABLE table_70552 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away captain at Brisbane Cricket Ground?
SELECT "Away captain" FROM table_70552 WHERE "Venue" = 'brisbane cricket ground'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC 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_inf...
css
CREATE TABLE table_14903355_2 ( men_doubles VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of men doubles for 2007
SELECT COUNT(men_doubles) FROM table_14903355_2 WHERE year = 2007
sql_create_context
CREATE TABLE table_name_13 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team against the Bolton Wanderers?
SELECT home_team FROM table_name_13 WHERE away_team = "bolton wanderers"
sql_create_context
CREATE TABLE table_204_52 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many were friendly competitions ?
SELECT COUNT(DISTINCT "date") FROM table_204_52 WHERE "competition" = 'friendly'
squall
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9719119' AND gwyjzb.MED_ORG_DEPT_CD = '9117' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9719119' AND fgwyjzb.MED_ORG_DEPT_CD = '9117') AND t...
css
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description...
SELECT DATEDIFF(day, Question.CreationDate, CreationDate) AS delay, COUNT(*) FROM (SELECT * FROM Posts WHERE PostTypeId = 2) AS Answer JOIN Posts AS Question ON Answer.ParentId = Question.Id WHERE Answer.OwnerUserId = '##UserId##' GROUP BY DATEDIFF(day, Question.CreationDate, CreationDate)
sede
CREATE TABLE table_203_412 ( id number, "school" text, "conference" text, "record (conference)" text, "head coach" text, "cws appearances" text, "cws best finish" text, "cws record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which wa...
SELECT "school" FROM table_203_412 WHERE "record (conference)" < 20
squall
CREATE TABLE table_name_83 ( venue VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Notes of 2:28:31?
SELECT venue FROM table_name_83 WHERE notes = "2:28:31"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description...
SELECT COUNT(RejectionDate), COUNT(ApprovalDate) FROM SuggestedEdits WHERE Comment LIKE '%@%.com' AND CreationDate > CURRENT_TIMESTAMP() - 360
sede
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
SELECT Time, ID FROM swimmer ORDER BY ID DESC
nvbench
CREATE TABLE table_40367 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of bronzes associated with 0 golds and a rank of 10?
SELECT SUM("Bronze") FROM table_40367 WHERE "Rank" = '10' AND "Gold" < '0'
wikisql
CREATE TABLE table_30988 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning Rider" text, "Winning Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the pole position(s) when rob guiver ...
SELECT "Pole Position" FROM table_30988 WHERE "Winning Rider" = 'Rob Guiver' AND "Fastest Lap" = 'Kyle Ryde'
wikisql
CREATE TABLE table_78429 ( "Track" real, "Recorded" text, "Catalogue" text, "Release Date" text, "Song Title" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the catalogue number for the song that is 3:17 and was released 9/2...
SELECT "Catalogue" FROM table_78429 WHERE "Release Date" = '9/21/71' AND "Time" = '3:17'
wikisql
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_p...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'NAVARCH' AND course.number = 562 AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester
advising
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Course_Authors_and_Tutors ( author_id IN...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish" ORDER BY COUNT(date_of_enrolment)
nvbench
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 * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3266292' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-09-14' AND '2018-06-15' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3266292' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-09-14' AND '2018-06-15' AND t_kc21.MED_ORG_DEPT_NM = '儿童口腔科'
css
CREATE TABLE table_42782 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" real, "Song" text, "Artist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Volume:Issue that has Peter Cetera as the artist and was on top for longer than 1 we...
SELECT "Volume:Issue" FROM table_42782 WHERE "Weeks on Top" > '1' AND "Artist" = 'peter cetera'
wikisql
CREATE TABLE table_71077 ( "DATE" text, "SCORE" text, "H.T." text, "VENUE" text, "COMPETITION" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the HT for the game at Zagreb, with a full-time score of 0-2?
SELECT "H.T." FROM table_71077 WHERE "VENUE" = 'zagreb' AND "SCORE" = '0-2'
wikisql