instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_53314 ( "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. -- Name the winning driver for havana
SELECT "Winning driver" FROM table_53314 WHERE "Circuit" = 'havana'
wikisql
CREATE TABLE table_name_37 ( date VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the week 17 game?
SELECT date FROM table_name_37 WHERE week = 17
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2120" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE city ( city_id number, city text, hanzi text, hanyu_pinyin text, regional_population number, gdp number ) CREATE TABLE match ( match_id number, date text, venue text, score text, result text, competition text ) CREATE TABLE hosting_city ( year number, ...
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_86 ( rider VARCHAR, laps VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the rider with 22 laps and a +19.435 time/retired?
SELECT rider FROM table_name_86 WHERE laps = "22" AND time_retired = "+19.435"
sql_create_context
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'leukocytosis' AND DATETIME(diagnosis.diagnosistime...
eicu
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '31931776' AND t_kc21.CLINIC_TYPE = '住院' AND MOD(t_kc21.MED_AMOUT, 1) = 0
css
CREATE TABLE table_78520 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the smallest grid for Prince bira?
SELECT MIN("Grid") FROM table_78520 WHERE "Driver" = 'prince bira'
wikisql
CREATE TABLE table_31489 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the civil parish of the cappanaboul townland?
SELECT "Civil parish" FROM table_31489 WHERE "Townland" = 'Cappanaboul'
wikisql
CREATE TABLE table_name_22 ( title VARCHAR, others VARCHAR, genre VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Title has Others of amstrad cpc, and a Genre of arcade?
SELECT title FROM table_name_22 WHERE others = "amstrad cpc" AND genre = "arcade"
sql_create_context
CREATE TABLE table_name_90 ( goals VARCHAR, years_at_club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the goals for the player whose years at club were 1908 1911, 1913 1919?
SELECT goals FROM table_name_90 WHERE years_at_club = "1908–1911, 1913–1919"
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "ED"
mimicsql_data
CREATE TABLE table_5291 ( "Season" text, "Champion" text, "Constructor" text, "Teams' Champion" text, "Secondary Class" text, "Nations Cup" text, "Winter Series Champion" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What secondary class of...
SELECT "Secondary Class" FROM table_5291 WHERE "Winter Series Champion" = 'andrew bentley'
wikisql
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
nvbench
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '68891668' UNION SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX ...
css
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
atis
CREATE TABLE table_43388 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Silver medals did the Nation with a Rank of less than 1 receive?
SELECT AVG("Silver") FROM table_43388 WHERE "Rank" < '1'
wikisql
CREATE TABLE table_62193 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the score 67-71-70=208?
SELECT "Place" FROM table_62193 WHERE "Score" = '67-71-70=208'
wikisql
CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_officer int, Case_burden int, Crime_rate real, Police_force text, Location text ) CREATE TABLE city ( City_ID int, County_ID int, Name text, White real, ...
SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_73 ( tries VARCHAR, played VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tries for the player whose number is greater than 2 and losses are smaller than 0?
SELECT COUNT(tries) FROM table_name_73 WHERE played > 2 AND lost < 0
sql_create_context
CREATE TABLE table_69632 ( "Competition" text, "Started Round" text, "Final Position" text, "Final Round" text, "First Match" text, "Last Match" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition had its first match on December 20, ...
SELECT "Competition" FROM table_69632 WHERE "First Match" = 'december 20, 2007'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2137" AND prescriptions.drug = "Glucagon"
mimicsql_data
CREATE TABLE table_name_91 ( american_labor_ticket VARCHAR, republican_ticket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which American Labor candidate ran against Republican Thomas E. Dewey?
SELECT american_labor_ticket FROM table_name_91 WHERE republican_ticket = "thomas e. dewey"
sql_create_context
CREATE TABLE table_30810 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the episode series number for 'The Devil Made Me ...
SELECT COUNT("Series #") FROM table_30810 WHERE "Title" = 'The Devil Made Me Do It'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "62" AND lab.itemid = "51382"
mimicsql_data
CREATE TABLE table_16297 ( "Season" text, "Series" text, "Team Name" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year...
SELECT "Season" FROM table_16297 WHERE "Team Name" = 'ART Grand Prix'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY DEPARTMENT_NAME ORDER BY DEPARTMENT_NAME DESC
nvbench
CREATE TABLE table_name_21 ( laps INTEGER, team VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps for mi-jack conquest racing when they went off course?
SELECT SUM(laps) FROM table_name_21 WHERE team = "mi-jack conquest racing" AND time_retired = "off course"
sql_create_context
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABL...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment)
nvbench
CREATE TABLE table_204_881 ( id number, "round" number, "date" text, "score" text, "opponent" text, "opponent's score" text, "result" text, "venue" text, "attendance" number, "best on ground" text, "team" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "venue" FROM table_204_881 WHERE "attendance" > 40000
squall
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
(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 table_56757 ( "Round" real, "Pick" real, "Name" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the round for Arizona with a pick over 100?
SELECT AVG("Round") FROM table_56757 WHERE "School" = 'arizona' AND "Pick" > '100'
wikisql
CREATE TABLE table_12881 ( "Season" text, "Level" text, "Goals" text, "Points" real, "Domestic Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season has a Level of 2nd, 29 points?
SELECT "Season" FROM table_12881 WHERE "Level" = '2nd' AND "Points" = '29'
wikisql
CREATE TABLE table_name_49 ( laps INTEGER, driver VARCHAR, grid VARCHAR, constructor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Laps for a grid smaller than 17, and a Constructor of williams - bmw, driven by jenson button?
SELECT AVG(laps) FROM table_name_49 WHERE grid < 17 AND constructor = "williams - bmw" AND driver = "jenson button"
sql_create_context
CREATE TABLE table_6790 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Total" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Report with a Score of 3 1, a...
SELECT "Report" FROM table_6790 WHERE "Score" = '3–1' AND "Set 1" = '19–25'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE table_name_27 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Footscray play as the away team?
SELECT venue FROM table_name_27 WHERE away_team = "footscray"
sql_create_context
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 ...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 644 AND NOT instructor.name LIKE '%Dustin Gamza%' AND offering_instructor.instructor_id = instructor.instructor_id AND offer...
advising
CREATE TABLE table_32643 ( "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 is the away side when carlton is the home s...
SELECT "Away team score" FROM table_32643 WHERE "Home team" = 'carlton'
wikisql
CREATE TABLE medicine ( name VARCHAR, trade_name VARCHAR, id VARCHAR ) CREATE TABLE medicine_enzyme_interaction ( medicine_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the medicine name and trade name which can both interact as 'inhibitor'...
SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor'
sql_create_context
CREATE TABLE table_name_20 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of the game with a Record of 12 7 6?
SELECT date FROM table_name_20 WHERE record = "12–7–6"
sql_create_context
CREATE TABLE table_name_62 ( episodes VARCHAR, tv_station VARCHAR, japanese_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episodes was the show shown on TBS?
SELECT episodes FROM table_name_62 WHERE tv_station = "tbs" AND japanese_title = "クロサギ"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, Di...
SELECT * FROM Posts WHERE AnswerCount < 2 AND PostTypeId = 1 AND Tags LIKE '%<wpf>%' AND AcceptedAnswerId IS NULL LIMIT 1000
sede
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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '袁幼怡' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2016-01-24' UNI...
css
CREATE TABLE table_name_59 ( college VARCHAR, position VARCHAR, round VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the College which has a Round smaller than 3, and a Pick # larger than 4, and a Position of wide receiver?...
SELECT college FROM table_name_59 WHERE round < 3 AND pick__number > 4 AND position = "wide receiver"
sql_create_context
CREATE TABLE table_18785 ( "City of license/Market" text, "Station" text, "Channel TV ( DT )" text, "Years owned" text, "Current Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What TV channel had a license from Boston?
SELECT "Channel TV ( DT )" FROM table_18785 WHERE "City of license/Market" = 'Boston'
wikisql
CREATE TABLE table_78130 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position is for Dr. Phillips high school?
SELECT "Position" FROM table_78130 WHERE "School" = 'dr. phillips high school'
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 course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester...
advising
CREATE TABLE table_name_19 ( player VARCHAR, position VARCHAR, points VARCHAR, goals VARCHAR, tries VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has 0 goals, 1 tries, 4 points, and plays in the Prop position?
SELECT player FROM table_name_19 WHERE goals = 0 AND tries = 1 AND points = 4 AND position = "prop"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND demographic.dod_year <= "2179.0"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT demographic.language FROM demographic WHERE demographic.name = "Paul Edwards"
mimicsql_data
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 Member_of ( FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR(15) ) CREATE TABLE Gradeconversion ( ...
SELECT T1.CName, COUNT(T1.CName) FROM Course AS T1 JOIN Enrolled_in AS T2 ON T1.CID = T2.CID GROUP BY T1.CName, T2.CID HAVING COUNT(*) >= 5 ORDER BY T1.CName DESC
nvbench
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuest...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC), Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Netherlands%' ORDER BY Reputation DESC
sede
CREATE TABLE table_59484 ( "Series" text, "Platform" text, "Japanese Release Date" text, "North American Release Date" text, "European Release Date" text, "Australia Release Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is North Amer...
SELECT "North American Release Date" FROM table_59484 WHERE "Japanese Release Date" = '2011-06-23'
wikisql
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 * FROM t_kc21 WHERE PERSON_NM = '凤乐和' AND MED_SER_ORG_NO = '2365508' AND MED_ORG_DEPT_NM LIKE '%科学%'
css
CREATE TABLE repair ( repair_id number, name text, launch_date text, notes text ) CREATE TABLE technician ( technician_id number, name text, team text, starting_year number, age number ) CREATE TABLE repair_assignment ( technician_id number, repair_id number, machine_id...
SELECT name FROM technician WHERE age = 36 OR age = 37
spider
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'surgical drains' AND STRFTIME('%y', treatment.treatmenttime) >= '2102')
eicu
CREATE TABLE table_23383 ( "Ballpark" text, "Location" text, "Team" text, "Opened" real, "Closed" real, "Demod" real, "Current Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the ballpark of the Twins?
SELECT "Location" FROM table_23383 WHERE "Team" = 'Twins'
wikisql
CREATE TABLE table_64623 ( "Award" text, "Category" text, "Year" real, "Title" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Category has a Year larger than 1996, and a Result of won, and a Title of brokeback mountain, and an A...
SELECT "Category" FROM table_64623 WHERE "Year" > '1996' AND "Result" = 'won' AND "Title" = 'brokeback mountain' AND "Award" = 'golden globe award'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '027-107035' AND STRFTIME('%y', patient.hospitaldischargetime) >= '2105' ORDER BY patient.hospitaldischargetime LIMIT 1
eicu
CREATE TABLE table_name_48 ( winner VARCHAR, home_team VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the winner when the home team is sioux falls storm and the year is earlier than 2012?
SELECT winner FROM table_name_48 WHERE home_team = "sioux falls storm" AND year < 2012
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT Team_Name, All_Games_Percent FROM basketball_match ORDER BY Team_Name
nvbench
CREATE TABLE table_70321 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the game played on February 18?
SELECT "Score" FROM table_70321 WHERE "Date" = 'february 18'
wikisql
CREATE TABLE table_77476 ( "Country" text, "Builder" text, "Location" text, "Ship" text, "Class / type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country is the John S. McCain Ship from?
SELECT "Country" FROM table_77476 WHERE "Ship" = 'john s. mccain'
wikisql
CREATE TABLE table_62134 ( "Round" real, "Race" text, "Circuit" text, "Date" text, "Event" text, "Winning driver" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Event, when Winning Driver is 'Laurent Aiello Laurent Aiello', when Round is...
SELECT "Event" FROM table_62134 WHERE "Winning driver" = 'laurent aiello laurent aiello' AND "Round" > '1' AND "Circuit" = 'wunstorf'
wikisql
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, LastEditorDispl...
SELECT UserId AS "user_link", COUNT(*) FROM Badges WHERE Name IN ('Socratic', 'Stellar Question', 'Great Question', 'Famous Question', 'Illuminator', 'Great Answer', 'Populist', 'Reversal', 'Unsung Hero', 'Fanatic', 'Legendary', 'Marshal', 'Constable', 'Sheriff', 'Steward', 'Copy Editor', 'Electorate', 'Publicist') GRO...
sede
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE i...
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19352) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1
mimic_iii
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9861939' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) < 3
css
CREATE TABLE table_name_9 ( honorary_professors INTEGER, lecturers VARCHAR, department VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of honorary professors in the economics department with 1 lecturer?
SELECT AVG(honorary_professors) FROM table_name_9 WHERE lecturers = 1 AND department = "economics"
sql_create_context
CREATE TABLE table_805 ( "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. -- how many...
SELECT "Game" FROM table_805 WHERE "Location Attendance" = 'Omni Coliseum 7,194'
wikisql
CREATE TABLE table_61091 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the player that had a to par score of +9 and took home less th...
SELECT "Score" FROM table_61091 WHERE "Money ( $ )" < '1,000' AND "To par" = '+9'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
SELECT Time, ID FROM swimmer ORDER BY Time
nvbench
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 PendingFlags ( Id number, FlagTypeId ...
SELECT ((DATEDIFF(DAY, '##StartDate:string##', CreationDate)) / 7) + 1 AS WeekNo, DATEADD(DAY, ((DATEDIFF(DAY, '##StartDate:string##', CreationDate)) / 7) * 7, '##StartDate:string##') AS WeekStarting, COUNT(P.Id) AS QuestionsAsked, COUNT(CASE WHEN Score > 0 THEN 1 END) AS PositiveScore, COUNT(CASE WHEN Score = 0 THEN 1...
sede
CREATE TABLE table_55265 ( "Class" text, "Wheels" text, "Date" text, "Builder" text, "No. Built" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What class has 4-4-0 wheels and was less than number 40 built?
SELECT "Class" FROM table_55265 WHERE "Wheels" = '4-4-0' AND "No. Built" < '40'
wikisql
CREATE TABLE table_49976 ( "Name" text, "Heir of" text, "Birth" text, "Ceased to be Duke of Girona" text, "Death" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE BIRTH DATE THAT HAS Ceased to be Duke of Girona OF 21 NOVEMBER 1582?
SELECT "Birth" FROM table_49976 WHERE "Ceased to be Duke of Girona" = '21 november 1582'
wikisql
CREATE TABLE People ( Name VARCHAR, Height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of people in ascending order of height?
SELECT Name FROM People ORDER BY Height
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT COUNT(mzjzjlb.ZZYSGH) 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 ...
css
CREATE TABLE table_name_14 ( year INTEGER, finish VARCHAR, start VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Year, when Finish is '29', and when Start is less than 24?
SELECT MIN(year) FROM table_name_14 WHERE finish = 29 AND start < 24
sql_create_context
CREATE TABLE table_204_579 ( id number, "code" text, "district" text, "headquarters" text, "population (as of 2011)" number, "area (km2)" number, "density (/km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total districts are ...
SELECT COUNT("district") FROM table_204_579
squall
CREATE TABLE table_204_897 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games were played at the ben hill griffin ...
SELECT COUNT(*) FROM table_204_897 WHERE "site" = 'ben hill griffin stadium • gainesville'
squall
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 ReviewTaskResults ( Id number, ReviewTaskId number, ...
SELECT COUNT(*) AS count, CONCAT(MONTH(p.CreationDate), '/', YEAR(p.CreationDate)) AS date, t.TagName FROM Posts AS p, Tags AS t, PostTags AS pt, PostTypes AS ptype WHERE pt.PostId = p.Id AND pt.TagId = t.Id AND p.PostTypeId = ptype.Id AND ptype.Name = 'Question' AND LOWER(t.TagName) LIKE 'cloudfoundry%' AND p.Creation...
sede
CREATE TABLE table_47973 ( "Year" real, "President" text, "(M) Finishing position" text, "(M) Coach" text, "(M) Best & Fairest" text, "(M) Leading Goalkicker" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the (M) Finishe position when ...
SELECT "(M) Finishing position" FROM table_47973 WHERE "President" = 'ray kaduck' AND "(M) Coach" = 'corey bowen'
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.insurance = "Medicare" AND demographic.dob_year < "2104"
mimicsql_data
CREATE TABLE table_8372 ( "Scorer" text, "Club" text, "League goals" text, "FA Cup goals" real, "League Cup goals" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of FA Cup goals for players with 12 League ...
SELECT MIN("FA Cup goals") FROM table_8372 WHERE "League goals" = '12' AND "Total" = '14'
wikisql
CREATE TABLE table_80327 ( "Week" real, "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the Baltimore Ravens play at home ?
SELECT "Date" FROM table_80327 WHERE "Host Team" = 'baltimore ravens'
wikisql
CREATE TABLE table_12134383_1 ( president VARCHAR, date_of_inauguration VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many president with date of inauguration being 4june1979
SELECT COUNT(president) FROM table_12134383_1 WHERE date_of_inauguration = "4June1979"
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...
SELECT txmzjzjlb.KH, txmzjzjlb.KLX FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '96594667159' UNION SELECT ftxmzjzjlb.KH, ftxmzjzjlb.KLX FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '96594667159'
css
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 microbiologyevents ( ro...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92721) AND STRFTIME('%y', labevents.charttime) >= '2105'
mimic_iii
CREATE TABLE table_65843 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which event before 2001 did the athlete place 16th?
SELECT "Event" FROM table_65843 WHERE "Year" < '2001' AND "Result" = '16th'
wikisql
CREATE TABLE table_4946 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "Winner's share ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the tournament that had a winner's share of $50,...
SELECT "Score" FROM table_4946 WHERE "Winner's share ( $ )" = '50,000'
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_148578_1 ( explosion VARCHAR, altitude__km_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What explosion had an altitude of 539 km?
SELECT explosion FROM table_148578_1 WHERE altitude__km_ = "539"
sql_create_context
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...
SELECT 1 + (SELECT COUNT(*) FROM Users AS a WHERE a.Reputation > u.Reputation) AS overall_rank, u.Reputation, u.DisplayName, u.CreationDate, u.Location, u.Id AS "user_link" FROM Users AS u WHERE LOWER(Location) LIKE '%algeria%' OR LOWER(Location) LIKE '%alg rie%' ORDER BY u.Reputation DESC
sede
CREATE TABLE table_name_25 ( tv_station VARCHAR, average_ratings VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What station has average ratings of 14.7%?
SELECT tv_station FROM table_name_25 WHERE average_ratings = "14.7%"
sql_create_context
CREATE TABLE student ( id VARCHAR, dept_name VARCHAR ) CREATE TABLE instructor ( name VARCHAR, salary VARCHAR, id VARCHAR ) CREATE TABLE advisor ( i_id VARCHAR, s_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name and salar...
SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math'
sql_create_context
CREATE TABLE table_name_67 ( crowd VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people in the crowd with Away team of geelong?
SELECT COUNT(crowd) FROM table_name_67 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE table_27369069_4 ( varsity_name VARCHAR, university VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the varsity name of the university of mcgill university?
SELECT varsity_name FROM table_27369069_4 WHERE university = "McGill university"
sql_create_context
CREATE TABLE table_17015_2 ( tongyong VARCHAR, chinese VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tongyong for chinese of
SELECT tongyong FROM table_17015_2 WHERE chinese = "湖內區"
sql_create_context
CREATE TABLE table_51739 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Time/Retired of Laps of 75?
SELECT "Time/Retired" FROM table_51739 WHERE "Laps" = '75'
wikisql
CREATE TABLE table_name_3 ( tally VARCHAR, county VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tally has a County of limerick, and a Rank larger than 1?
SELECT tally FROM table_name_3 WHERE county = "limerick" AND rank > 1
sql_create_context