instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) ) CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80...
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY AVG(product_price) DESC
nvbench
CREATE TABLE table_202_197 ( id number, "year" number, "round" number, "gp" number, "w" number, "d" number, "l" number, "gf" number, "ga" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the largest gf in team history in the...
SELECT MAX("gf") FROM table_202_197
squall
CREATE TABLE table_204_742 ( id number, "release date" text, "single title" text, "uk singles chart\nposition" number, "french\ncharts" number, "german\ncharts" number, "irish\ncharts" number, "various" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "single title" FROM table_204_742 WHERE "single title" IN ('"sister mary" (duet with joe dolan)', '"run to me"') ORDER BY "release date" LIMIT 1
squall
CREATE TABLE table_1028356_3 ( year VARCHAR, championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the championship in Wimbledon (2)?
SELECT year FROM table_1028356_3 WHERE championship = "Wimbledon (2)"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text,...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'blood culture ( myco/f lytic bottle)' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-3 year'))
mimic_iii
CREATE TABLE table_23924 ( "Name" text, "#" real, "Height" text, "Weight" real, "Position" text, "Year" text, "Home Town" text, "High School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home town of David Noel?
SELECT "Home Town" FROM table_23924 WHERE "Name" = 'David Noel'
wikisql
CREATE TABLE table_name_72 ( director VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had notes of Prizzi's Honor?
SELECT director FROM table_name_72 WHERE notes = "prizzi's honor"
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER
nvbench
CREATE TABLE table_78478 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for 7 may 2000
SELECT "Score" FROM table_78478 WHERE "Date" = '7 may 2000'
wikisql
CREATE TABLE table_56600 ( "Season" text, "Club" text, "League" text, "Apps." real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Major League Soccer team for the 2005 season has the lowest goals?
SELECT MIN("Goals") FROM table_56600 WHERE "League" = 'major league soccer' AND "Season" = '2005'
wikisql
CREATE TABLE table_21577 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the minimum kerry # for bush % for 50.9%
SELECT MIN("Kerry#") FROM table_21577 WHERE "Bush%" = '50.9%'
wikisql
CREATE TABLE table_53764 ( "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 lowest total when the Bronze metals are larger than 0 and the nation is France (fra)?
SELECT MIN("Total") FROM table_53764 WHERE "Bronze" > '0' AND "Nation" = 'france (fra)'
wikisql
CREATE TABLE table_2194 ( "Episode" text, "First broadcast" text, "Rufus guest" text, "Marcus guest" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the first broadcast for episodes where Rufus's guest is Jack Whitehall?
SELECT "First broadcast" FROM table_2194 WHERE "Rufus guest" = 'Jack Whitehall'
wikisql
CREATE TABLE table_52266 ( "model" text, "cylinders/ valves" text, "displacement cc" real, "max. power kW (PS) at rpm" text, "max. torque (Nm) at rpm" text, "engine code" text, "top speed (km/h)" real, "production period" text ) -- Using valid SQLite, answer the following questions for...
SELECT "max. torque (Nm) at rpm" FROM table_52266 WHERE "model" = '1.4 16v'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
SELECT t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24....
css
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname 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, test_id varchar ) CREA...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_...
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE department ( dept_co...
SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name FROM class AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code
spider
CREATE TABLE table_1354805_6 ( competition_finish INTEGER, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest number where people got done at 31.1
SELECT MAX(competition_finish) FROM table_1354805_6 WHERE average = "31.1"
sql_create_context
CREATE TABLE ref_product_categories ( product_category_description VARCHAR, product_category_code VARCHAR ) CREATE TABLE products ( product_category_code VARCHAR, product_description VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the category d...
SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%'
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
SELECT Votes.CreationDate, COUNT(*) AS Num FROM Posts INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.OwnerUserId = @UserId AND Votes.VoteTypeId = 1 GROUP BY Votes.CreationDate ORDER BY Votes.CreationDate
sede
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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, ...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '章乐悦' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_19530 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the show directed by Michael Dimartino firs...
SELECT "Original air date" FROM table_19530 WHERE "Directed by" = 'Michael DiMartino'
wikisql
CREATE TABLE table_20747 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Date" text, "Crowd" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the home team for football park
SELECT "Home team" FROM table_20747 WHERE "Ground" = 'Football Park'
wikisql
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TA...
SELECT time, train_number FROM train WHERE destination = 'Chennai'
nvbench
CREATE TABLE table_79026 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MIN("Goals for") FROM table_79026 WHERE "Played" > '30'
wikisql
CREATE TABLE table_20665 ( "Code" real, "County" text, "Former Province" text, "Area (km 2 )" text, "Population Census 2009" real, "Capital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what former province was the area 694.9 kilometers squ...
SELECT "Former Province" FROM table_20665 WHERE "Area (km 2 )" = '694.9'
wikisql
CREATE TABLE table_203_344 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text, "other info" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "#" FROM table_203_344 ORDER BY "attendance" DESC LIMIT 1
squall
CREATE TABLE table_23612439_2 ( final_score VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the final score when 22210 is the attendance?
SELECT final_score FROM table_23612439_2 WHERE attendance = 22210
sql_create_context
CREATE TABLE table_203_322 ( id number, "club" text, "played" number, "won" number, "drawn" number, "lost" number, "points for" number, "points against" number, "bonus points" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT (SELECT "won" FROM table_203_322 WHERE "club" = 'stade toulousain') - (SELECT "won" FROM table_203_322 WHERE "club" = 'ca brive')
squall
CREATE TABLE table_22822468_2 ( share INTEGER, viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most share for 2.76 million viewers
SELECT MAX(share) FROM table_22822468_2 WHERE viewers__millions_ = "2.76"
sql_create_context
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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'protein - csf')
eicu
CREATE TABLE city ( city_id number, county_id number, name text, white number, black number, amerindian number, asian number, multiracial number, hispanic number ) CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers num...
SELECT hispanic FROM city WHERE black > 10
spider
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE ground_service ( city_code text, airp...
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 ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
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. -- what opponent is below belgium ?
SELECT "opponent" FROM table_204_52 WHERE id = (SELECT id FROM table_204_52 WHERE "opponent" = 'belgium') + 1
squall
CREATE TABLE table_203_30 ( id number, "place" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals\nscored" number, "goals\nconceded" number, "+/-" number, "points" number ) -- Using valid SQLite, answer the following questions for the t...
SELECT "team" FROM table_203_30 ORDER BY "place" DESC LIMIT 1
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2156" AND lab.itemid = "51383"
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 d_icd_procedures ( row_id number, icd9_code text, s...
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 15135 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_19611329_1 ( inducted_as VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the inducted as for joe medwick category:articles with hcards
SELECT inducted_as FROM table_19611329_1 WHERE player = "Joe Medwick Category:Articles with hCards"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2148.0" AND lab.label = "Calculated TBG"
mimicsql_data
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Gradeconversion ( lettergrade VARCHAR(2), gradepoint FLOAT ) CREATE TABLE Minor_in ( StuID INTEGER, ...
SELECT Days, COUNT(Days) FROM Course GROUP BY Days ORDER BY Credits
nvbench
CREATE TABLE table_75025 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Record of 22 20 involved what score?
SELECT "Score" FROM table_75025 WHERE "Record" = '22–20'
wikisql
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 * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '戚欣合' AND gwyjzb.MED_SER_ORG_NO = '5382017' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%肾科%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '戚欣合' AND fgwyjzb.MED_SER_ORG_NO = '5382017' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%肾科%'
css
CREATE TABLE table_26168687_3 ( vessel_type VARCHAR, vessel_operator VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the vessel type for vessel operator Jumbo shipping?
SELECT vessel_type FROM table_26168687_3 WHERE vessel_operator = "Jumbo Shipping"
sql_create_context
CREATE TABLE table_203_461 ( id number, "dvd title" text, "discs" number, "year" text, "no. of ep." number, "dvd release\nregion 2" text, "dvd release\nregion 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what comes immediately after com...
SELECT "dvd title" FROM table_203_461 WHERE id = (SELECT id FROM table_203_461 WHERE "dvd title" = 'complete series 11') + 1
squall
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 labevents ( row_id number, subject_id number, hadm_...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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 = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_1859855_2 ( age INTEGER, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When columbia, south carolina is the hometown what is the lowest age?
SELECT MIN(age) FROM table_1859855_2 WHERE hometown = "Columbia, South Carolina"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, ...
SELECT * FROM Posts, PostTypes WHERE Posts.PostTypeId = PostTypes.Id AND PostTypes.Id = 1 AND Posts.CreationDate BETWEEN '2015-03-08 00:00:00' AND '2015-03-08 23:59:59' ORDER BY Posts.ViewCount DESC LIMIT 50
sede
CREATE TABLE table_name_30 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date(s) was the game(s) at Candlestick Park?
SELECT date FROM table_name_30 WHERE venue = "candlestick park"
sql_create_context
CREATE TABLE table_36443 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Vancouver canucks game was on a date closest to November 4?
SELECT MAX("Game") FROM table_36443 WHERE "Opponent" = 'vancouver canucks' AND "November" < '4'
wikisql
CREATE TABLE table_15700367_4 ( wickets VARCHAR, overs_bowled VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the wickets when overs bowled is 9
SELECT wickets FROM table_15700367_4 WHERE overs_bowled = "9"
sql_create_context
CREATE TABLE table_5641 ( "Gatchaman" text, "Battle of the Planets" text, "G-Force" text, "Eagle Riders" text, "OVA (Harmony Gold Dub)" text, "Rank" text, "Bird Uniform" text, "Weapon" text, "Mecha" text, "Japanese voice actor" text, "Voice actor (BOTP)" text, "Voice acto...
SELECT "Rank" FROM table_5641 WHERE "Gatchaman" = 'jinpei'
wikisql
CREATE TABLE table_name_96 ( place VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Place of the Player with a To par of 6?
SELECT place FROM table_name_96 WHERE to_par = "–6"
sql_create_context
CREATE TABLE table_name_17 ( goals_scored VARCHAR, played VARCHAR, points VARCHAR, goals_conceded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total goals scored with more than 11 points, 18 goals conceded, and played fewer than 18 time...
SELECT COUNT(goals_scored) FROM table_name_17 WHERE points > 11 AND goals_conceded = 18 AND played < 18
sql_create_context
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) DESC
nvbench
CREATE TABLE table_17585 ( "Rank" real, "Peak" text, "Elevation (m)" real, "Prominence (m)" real, "Isolation (km)" real, "Municipality" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the county with an elevation of 126...
SELECT "County" FROM table_17585 WHERE "Elevation (m)" = '1262'
wikisql
CREATE TABLE table_63149 ( "Time" text, "Home team" text, "Score" text, "Away team" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time is it for the southern home team?
SELECT "Time" FROM table_63149 WHERE "Home team" = 'southern'
wikisql
CREATE TABLE table_910 ( "Local Government Area" text, "Principal town" text, "Land Area (km\u00b2)" text, "Population 2011 census" real, "Density" text, "Region" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population density in t...
SELECT "Density" FROM table_910 WHERE "Principal town" = 'Brighton'
wikisql
CREATE TABLE table_name_96 ( mary_davis VARCHAR, gay_mitchell VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Mary Davis with a Gay Mitchell that is 4.6%?
SELECT mary_davis FROM table_name_96 WHERE gay_mitchell = "4.6%"
sql_create_context
CREATE TABLE table_53311 ( "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. -- Tell me the report with winner of louis wagner
SELECT "Report" FROM table_53311 WHERE "Winning driver" = 'louis wagner'
wikisql
CREATE TABLE table_name_70 ( b_score INTEGER, total VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the B Score when the total is more than 16.125, and position is 3rd?
SELECT SUM(b_score) FROM table_name_70 WHERE total > 16.125 AND position = "3rd"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT * 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 = '23126323' AND hz_info.YLJGDM = '2184508' AND NOT zyjzjlb.CYKSMC LIKE '%美容%'
css
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), CO...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_18703133_6 ( scored INTEGER, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is scored with the position of 6?
SELECT MIN(scored) FROM table_18703133_6 WHERE position = 6
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int,...
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 499 OR course.number = 162) AND course_offering.end_time > '17:00:00' AND semester.semester = 'WN' AND semester.year = ...
advising
CREATE TABLE table_1930857_1 ( gender VARCHAR, year_founded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the gender of the students taught in the school founded in 1894?
SELECT gender FROM table_1930857_1 WHERE year_founded = "1894"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number...
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 = '012-63986')) AND medication.drugname IN ('sublimaze', 'dextrose 50%', 'lor...
eicu
CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Incident_Type ( ...
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_19418696_3 ( yards VARCHAR, qb_rating VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many yardage figures for the player with 72.3 QB rating?
SELECT COUNT(yards) FROM table_19418696_3 WHERE qb_rating = "72.3"
sql_create_context
CREATE TABLE table_36278 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the record was 7-2, what was the score for the game?
SELECT "Score" FROM table_36278 WHERE "Record" = '7-2'
wikisql
CREATE TABLE table_49739 ( "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 Player had a Score of 75-73-68-65=281 and more than 19,009 in Money?
SELECT "Player" FROM table_49739 WHERE "Money ( $ )" > '19,009' AND "Score" = '75-73-68-65=281'
wikisql
CREATE TABLE table_name_84 ( location VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the match with the record 10-8-1?
SELECT location FROM table_name_84 WHERE record = "10-8-1"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, AVG(Price) FROM Products GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE table_19651669_1 ( final_venue VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many final venues were there in the 1997-98 season?
SELECT COUNT(final_venue) FROM table_19651669_1 WHERE season = "1997-98"
sql_create_context
CREATE TABLE table_name_45 ( league_goals INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total League goals does Player John O'Flynn have?
SELECT SUM(league_goals) FROM table_name_45 WHERE player = "john o'flynn"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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 ...
SELECT t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3990035' GROUP BY t_kc21.OUT_DIAG_DIS_NM
css
CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_phone_number text ...
SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM customers
spider
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_ty...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6374 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'mrsa screen' AND NOT microbiologyevents....
mimic_iii
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
SELECT Users.Id, usersAnswers.Answers, Users.Reputation, (Users.Reputation / UsersAnswers.Answers) AS Ratio FROM (SELECT U.Id, COUNT(Posts.Id) AS Answers FROM Posts, Users AS U WHERE Posts.OwnerUserId = U.Id AND Posts.PostTypeId = 2 GROUP BY U.Id) AS UsersAnswers, Users WHERE UsersAnswers.Id = Users.Id ORDER BY Ratio D...
sede
CREATE TABLE table_1305623_12 ( gold_medals VARCHAR, total_medals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many gold medals does each school who has a total of 1 medal have?
SELECT gold_medals FROM table_1305623_12 WHERE total_medals = 1
sql_create_context
CREATE TABLE table_16226584_1 ( name VARCHAR, km_from_kingston VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which railroad is 112.6 kilometers from kingston?
SELECT name FROM table_16226584_1 WHERE km_from_kingston = "112.6"
sql_create_context
CREATE TABLE table_488 ( "Celebrity" text, "Background" text, "Original Team" text, "Age" real, "Hometown" text, "Charity" text, "Result" text, "Raised" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is the charity that the backgro...
SELECT "Charity" FROM table_488 WHERE "Background" = 'Heavyweight Champion'
wikisql
CREATE TABLE table_34414 ( "Country" text, "Project Name" text, "Year startup" text, "Operator" text, "Peak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the startup for the Project Named of taq taq ph 2?
SELECT "Year startup" FROM table_34414 WHERE "Project Name" = 'taq taq ph 2'
wikisql
CREATE TABLE table_203_665 ( id number, "name" text, "municipality" text, "established" number, "tower height\nin meters (ft)" text, "focal plane\nin meters (ft)" text, "current status" text, "current condition" text ) -- Using valid SQLite, answer the following questions for the table...
SELECT 1889 - 1882
squall
CREATE TABLE table_69270 ( "Race" text, "Dist (f)" real, "Course" text, "Prize (\u00a3K)" real, "Runners" real, "Placing" real, "Margin" text, "Jockey" text, "Trainer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total run...
SELECT SUM("Runners") FROM table_69270 WHERE "Jockey" = 'olivier peslier' AND "Placing" < '2'
wikisql
CREATE TABLE table_37850 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Difference of - 20, and a Position smaller than...
SELECT MAX("Against") FROM table_37850 WHERE "Difference" = '- 20' AND "Position" < '17'
wikisql
CREATE TABLE table_name_49 ( winner VARCHAR, course VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the course Brescia?
SELECT winner FROM table_name_49 WHERE course = "brescia"
sql_create_context
CREATE TABLE table_11843 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score on august 1
SELECT "Score" FROM table_11843 WHERE "Date" = 'august 1'
wikisql
CREATE TABLE table_203_593 ( id number, "tenure" text, "coach" text, "years" number, "record" text, "pct." number, "ncaa tournament" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which head coach had the top win percentage ?
SELECT "coach" FROM table_203_593 WHERE "pct." = (SELECT MAX("pct.") FROM table_203_593)
squall
CREATE TABLE table_name_41 ( finished VARCHAR, entered VARCHAR, exited VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the celebrity finish that entered on day 1 and exited on day 15?
SELECT finished FROM table_name_41 WHERE entered = "day 1" AND exited = "day 15"
sql_create_context
CREATE TABLE table_name_81 ( lost INTEGER, points VARCHAR, draw VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest number lost with 0 draws and less than 12 points for Gwardia Katowice?
SELECT MAX(lost) FROM table_name_81 WHERE draw = 0 AND team = "gwardia katowice" AND points < 12
sql_create_context
CREATE TABLE fielding_outfield ( player_id TEXT, year INTEGER, stint INTEGER, glf NUMERIC, gcf NUMERIC, grf NUMERIC ) CREATE TABLE home_game ( year INTEGER, league_id TEXT, team_id TEXT, park_id TEXT, span_first TEXT, span_last TEXT, games INTEGER, openings INTEG...
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid ORDER BY yearid DESC
nvbench
CREATE TABLE table_2076463_2 ( control VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of school would you see when visiting Missouri Western State University?
SELECT control FROM table_2076463_2 WHERE school = "Missouri Western State University"
sql_create_context
CREATE TABLE table_name_87 ( podiums VARCHAR, points VARCHAR, wins VARCHAR, fl VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of podiums with 0 wins, 0 F.L. and 35 points?
SELECT podiums FROM table_name_87 WHERE wins = "0" AND fl = "0" AND points = "35"
sql_create_context
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 ReviewRejectionReasons ( Id number, Name text, Descr...
SELECT udfp.OwnerUserId AS "user_link", COUNT(p2.Id) AS futureposts FROM (SELECT p.OwnerUserId, MIN(p.CreationDate) AS dfp FROM Posts AS p WHERE p.PostTypeId < 3 GROUP BY p.OwnerUserId) AS udfp LEFT OUTER JOIN Posts AS p2 ON p2.OwnerUserId = udfp.OwnerUserId AND CAST((JULIANDAY(CreationDate) - JULIANDAY(udfp.dfp)) AS I...
sede
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, h...
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 = 3369)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe...
mimic_iii
CREATE TABLE table_2527063_3 ( rank VARCHAR, growth_rate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of rank for growth raate for 14.47
SELECT COUNT(rank) FROM table_2527063_3 WHERE growth_rate = "14.47"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, U...
SELECT Score, COUNT(Id) FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = 6309 GROUP BY Score ORDER BY Score DESC
sede