instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_51256 ( "Mountain West" text, "Lost" real, "Tied" real, "Pct." real, "Years" real, "Total Games" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games tied for the air force with over 57 years participating?
SELECT COUNT("Tied") FROM table_51256 WHERE "Mountain West" = 'air force' AND "Years" > '57'
wikisql
CREATE TABLE table_name_82 ( week INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Weeks have a Result of w 17 13?
SELECT AVG(week) FROM table_name_82 WHERE result = "w 17–13"
sql_create_context
CREATE TABLE table_name_69 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of Collingwood?
SELECT home_team AS score FROM table_name_69 WHERE home_team = "collingwood"
sql_create_context
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( ...
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001') AND patient.unitdischargetime IS NULL) AND ...
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 yea...
eicu
CREATE TABLE table_15917 ( "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many of the schools listed are in...
SELECT COUNT("Primary conference") FROM table_15917 WHERE "Location" = 'Ames, IA'
wikisql
CREATE TABLE table_15243 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country that placed 4?
SELECT "Country" FROM table_15243 WHERE "Place" = '4'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT CIVIL_SUBSIDY FROM t_kc24 WHERE MED_CLINIC_ID = '03902994477'
css
CREATE TABLE prescribes ( physician number, patient number, medication number, date time, appointment number, dose text ) CREATE TABLE department ( departmentid number, name text, head number ) CREATE TABLE medication ( code number, name text, brand text, descriptio...
SELECT COUNT(DISTINCT roomtype) FROM room
spider
CREATE TABLE table_204_504 ( id number, "year" number, "award" text, "category" text, "work" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many awards has victoria rowell won ?
SELECT COUNT("award") FROM table_204_504 WHERE "result" = 'won'
squall
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE T...
SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'HP'
atis
CREATE TABLE table_30814 ( "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. -- How many episode titles have series number 4?
SELECT COUNT("Title") FROM table_30814 WHERE "Series #" = '4'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-105495' AND patient.hospitaldischargetime IS NULL)) AND treat...
eicu
CREATE TABLE table_30620 ( "No" real, "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the entrant for bruno sterzi
SELECT "Entrant" FROM table_30620 WHERE "Driver" = 'Bruno Sterzi'
wikisql
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Date_of_Birth, Height FROM people ORDER BY Height DESC
nvbench
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 txmzjzjlb.JLSJ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '15752379757' UNION SELECT ftxmzjzjlb.JLSJ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '15752379757'
css
CREATE TABLE table_name_12 ( laps INTEGER, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the low lap total for a grid of 14?
SELECT MIN(laps) FROM table_name_12 WHERE grid = 14
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.dob_year < "2080"
mimicsql_data
CREATE TABLE table_name_96 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Attendance with a Date that is november 25, 1965?
SELECT attendance FROM table_name_96 WHERE date = "november 25, 1965"
sql_create_context
CREATE TABLE table_1569625_1 ( tournament VARCHAR, margin_of_victory VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tournament when margin of victory is 3 strokes and winning score is 71-66-70-67=274
SELECT tournament FROM table_1569625_1 WHERE margin_of_victory = "3 strokes" AND winning_score = 71 - 66 - 70 - 67 = 274
sql_create_context
CREATE TABLE table_name_96 ( type VARCHAR, date VARCHAR, president VARCHAR, year VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Type with a Year larger than 2010, and a Location with justus lipsius building, brussels...
SELECT type FROM table_name_96 WHERE year > 2010 AND location = "justus lipsius building, brussels" AND president = "herman van rompuy (2nd term)" AND date = "28–29 june"
sql_create_context
CREATE TABLE table_68422 ( "INEGI code" real, "Municipality" text, "Municipal seat" text, "Population (2010)" real, "Area (Km2)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the inegi code for mexicali with 13,700 km area?
SELECT AVG("INEGI code") FROM table_68422 WHERE "Municipal seat" = 'mexicali' AND "Area (Km2)" > '13,700'
wikisql
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '矽肺(硅肺)Ⅲ期' AND jyjgzbb.JCZBDM = ...
css
CREATE TABLE table_name_93 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date when the away team is essendon?
SELECT date FROM table_name_93 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis - sepsis...
eicu
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 prescriptions.drug, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Frank Gregory"
mimicsql_data
CREATE TABLE table_1805191_6 ( results VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the result(s) of the election featuring grace napolitano as the incumbent?
SELECT results FROM table_1805191_6 WHERE incumbent = "Grace Napolitano"
sql_create_context
CREATE TABLE table_204_293 ( id number, "district" number, "name" text, "party" text, "district office" text, "first elected" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was elected earlier , amedee or cortez ?
SELECT "name" FROM table_204_293 WHERE "name" IN ('jody amedee', 'page cortez') ORDER BY "first elected" LIMIT 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeou...
SELECT COUNT(*) FROM medication WHERE medication.drugname = 'multivitamins' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-2 year')
eicu
CREATE TABLE table_63484 ( "Round" text, "Main date" text, "Number of fixtures" real, "Clubs" text, "New entries this round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when there were 48 32 clubs?
SELECT "New entries this round" FROM table_63484 WHERE "Clubs" = '48 → 32'
wikisql
CREATE TABLE table_49626 ( "Year" text, "Gold" text, "Silver" text, "Bronze" text, "Host city / cities" text, "Host country / countries" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the gold in 1958?
SELECT "Gold" FROM table_49626 WHERE "Year" = '1958'
wikisql
CREATE TABLE table_name_40 ( attendance VARCHAR, week VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance in the bye week after week 5?
SELECT attendance FROM table_name_40 WHERE week > 5 AND opponent = "bye"
sql_create_context
CREATE TABLE tourist_attraction_features ( tourist_attraction_id number, feature_id number ) CREATE TABLE shops ( shop_id number, shop_details text ) CREATE TABLE royal_family ( royal_family_id number, royal_family_details text ) CREATE TABLE hotels ( hotel_id number, star_rating_code...
SELECT hotel_id, star_rating_code FROM hotels ORDER BY price_range
spider
CREATE TABLE table_name_61 ( country VARCHAR, catalogue_no VARCHAR, format VARCHAR, label VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country that has the format of cd, the label of sony music and the catalogue no sicp-2055?
SELECT country FROM table_name_61 WHERE format = "cd" AND label = "sony music" AND catalogue_no = "sicp-2055"
sql_create_context
CREATE TABLE table_name_94 ( high_assists VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the number of high assists for game 1?
SELECT high_assists FROM table_name_94 WHERE game = 1
sql_create_context
CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age...
SELECT Location, COUNT(Location) FROM party GROUP BY Location
nvbench
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 wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '9...
css
CREATE TABLE table_name_33 ( event VARCHAR, method VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event has a Method of submission (triangle choke), and an Opponent of thiago tavares?
SELECT event FROM table_name_33 WHERE method = "submission (triangle choke)" AND opponent = "thiago tavares"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_req...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS V...
atis
CREATE TABLE table_34375 ( "Place" real, "Nation" text, "6 Ropes" real, "4 Hoops, 2 Clubs" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the palce number of Russia, which has 6 ropes of 19.425 and a total less than 38.925?
SELECT SUM("Place") FROM table_34375 WHERE "6 Ropes" = '19.425' AND "Nation" = 'russia' AND "Total" < '38.925'
wikisql
CREATE TABLE user_profiles ( uid number, name text, email text, partitionid number, followers number ) CREATE TABLE follows ( f1 number, f2 number ) CREATE TABLE tweets ( id number, uid number, text text, createdate time ) -- Using valid SQLite, answer the following quest...
SELECT COUNT(*) FROM tweets
spider
CREATE TABLE table_name_53 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result on November 1, 1992?
SELECT result FROM table_name_53 WHERE date = "november 1, 1992"
sql_create_context
CREATE TABLE table_name_73 ( ties INTEGER, team VARCHAR, games_played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average ties when the team is montreal victorias and the games played is more than 8?
SELECT AVG(ties) FROM table_name_73 WHERE team = "montreal victorias" AND games_played > 8
sql_create_context
CREATE TABLE table_28720 ( "Monarch" text, "Heir" text, "Status" text, "Relationship to Monarch" text, "Became heir; reason" text, "Ceased to be heir; reason" text, "Next in succession" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is t...
SELECT "Monarch" FROM table_28720 WHERE "Became heir; reason" = '13 July 1783 father succeeded'
wikisql
CREATE TABLE table_78608 ( "Letter" text, "Pronunciation spelled free" text, "Pronunciation spelled checked" text, "Example spelled free" text, "Example spelled checked" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Example Spelled Free, wh...
SELECT "Example spelled free" FROM table_78608 WHERE "Example spelled checked" = 'op /ɔp/ ("on")'
wikisql
CREATE TABLE table_21348 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Competition" text, "Man of the Match" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result for lukas smital and home
SELECT "Result" FROM table_21348 WHERE "Man of the Match" = 'Lukas Smital' AND "Venue" = 'Home'
wikisql
CREATE TABLE table_name_78 ( year INTEGER, floors INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the average year that the number of floors was greater than 75?
SELECT AVG(year) FROM table_name_78 WHERE floors > 75
sql_create_context
CREATE TABLE table_17229 ( "State" text, "Norwegian Americans (1980)" real, "Percent (1980)" text, "Norwegian Americans (1990)" real, "Percent (1990)" text, "Norwegian Americans (2000)" real, "Percent (2000)" text, "Norwegian Americans (2009)" real, "Percent (2009)" text ) -- Using...
SELECT MAX("Norwegian Americans (2000)") FROM table_17229 WHERE "Norwegian Americans (1990)" = '9170'
wikisql
CREATE TABLE table_name_62 ( crowd VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What size was the crowd when Hawthorn was the home team?
SELECT COUNT(crowd) FROM table_name_62 WHERE home_team = "hawthorn"
sql_create_context
CREATE TABLE table_203_771 ( id number, "#" number, "artist" text, "featuring" text, "title" text, "version" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the title of the first track on the best of benassi bros great...
SELECT "title" FROM table_203_771 ORDER BY "#" LIMIT 1
squall
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'oxycodone-acetaminophen elixir' AND STRFTIME('%y', prescriptions....
mimic_iii
CREATE TABLE table_64556 ( "Year" real, "Champion" text, "Score" text, "Runner-up" text, "City" text, "Arena" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner-up at the Broadmoor Arena before 2008?
SELECT "Runner-up" FROM table_64556 WHERE "Year" < '2008' AND "Arena" = 'broadmoor arena'
wikisql
CREATE TABLE table_name_43 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team score when the away team was Carlton?
SELECT home_team AS score FROM table_name_43 WHERE away_team = "carlton"
sql_create_context
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show ...
SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY stars DESC
nvbench
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Hemodialysis"
mimicsql_data
CREATE TABLE table_27987623_1 ( us_viewers__in_million_ VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many viewers saw the episode written by kevin biegel & bill lawrence?
SELECT us_viewers__in_million_ FROM table_27987623_1 WHERE written_by = "Kevin Biegel & Bill Lawrence"
sql_create_context
CREATE TABLE table_64195 ( "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's the bronze medal count for Rank 33 when the silver count was less than 2 and the tota...
SELECT MAX("Bronze") FROM table_64195 WHERE "Silver" < '2' AND "Total" > '4' AND "Rank" = '33'
wikisql
CREATE TABLE table_name_82 ( constellation VARCHAR, hd_designation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Constellation, when HD Designation is 'HD197076'?
SELECT constellation FROM table_name_82 WHERE hd_designation = "hd197076"
sql_create_context
CREATE TABLE table_name_24 ( year VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years have 78 for points?
SELECT COUNT(year) FROM table_name_24 WHERE points = 78
sql_create_context
CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(15), product_name VARCHAR(80), ...
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name
nvbench
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-47...
mimic_iii
CREATE TABLE table_name_62 ( city VARCHAR, aam_member VARCHAR, astc_member VARCHAR, state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is City, when ASTC Member is No, when State is California, and when AAM Member is Yes?
SELECT city FROM table_name_62 WHERE astc_member = "no" AND state = "california" AND aam_member = "yes"
sql_create_context
CREATE TABLE table_name_22 ( overall INTEGER, college VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Overall, when College is 'Arkansas State', and when Pick is less than 17?
SELECT SUM(overall) FROM table_name_22 WHERE college = "arkansas state" AND pick < 17
sql_create_context
CREATE TABLE table_60168 ( "Model" text, "Screen size" text, "Bluetooth" text, "FM transmitter" text, "Flash" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Does the s35 model have bluetooth?
SELECT "Bluetooth" FROM table_60168 WHERE "Model" = 's35'
wikisql
CREATE TABLE table_204_103 ( id number, "medal" text, "name" text, "sport" text, "event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many silver medals did satheesha rai win according to the table ?
SELECT COUNT("medal") FROM table_204_103 WHERE "name" = 'satheesha rai'
squall
CREATE TABLE table_35703 ( "Molecular formula" text, "IUPAC name" text, "CAS registry number" text, "Common name" text, "Other names" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IUPAC name for chloroform?
SELECT "IUPAC name" FROM table_35703 WHERE "Common name" = 'chloroform'
wikisql
CREATE TABLE table_name_17 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has 104-113 as the score?
SELECT date FROM table_name_17 WHERE score = "104-113"
sql_create_context
CREATE TABLE table_77287 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location did the event kotc: mortal sins take ...
SELECT "Location" FROM table_77287 WHERE "Event" = 'kotc: mortal sins'
wikisql
CREATE TABLE table_name_65 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the match against carlisle united?
SELECT date FROM table_name_65 WHERE away_team = "carlisle united"
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 jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND ...
css
CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) -- U...
SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY Country DESC
nvbench
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78221) AND prescriptions.route = 'po' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-08' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PORT" AND demographic.days_stay > "3"
mimicsql_data
CREATE TABLE table_name_56 ( category VARCHAR, director_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what category is for tom shankland, director?
SELECT category FROM table_name_56 WHERE director_s_ = "tom shankland"
sql_create_context
CREATE TABLE table_name_49 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who held the same position in 2014 that Danielle Button held in 2013?
SELECT 2014 FROM table_name_49 WHERE 2013 = "danielle button"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507')) AND intakeoutput.cellpath LIKE '%intake%' AND D...
eicu
CREATE TABLE table_name_75 ( week INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest week that has Minnesota Vikings as the opponent?
SELECT MIN(week) FROM table_name_75 WHERE opponent = "minnesota vikings"
sql_create_context
CREATE TABLE table_11900773_5 ( design VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was responsible for the design of the Jasper National Park theme?
SELECT design FROM table_11900773_5 WHERE theme = "Jasper National Park"
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 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 jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2010-11-18')
css
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 5)
mimic_iii
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime 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_icd_diagnoses WHERE d_icd_di...
mimic_iii
CREATE TABLE table_53982 ( "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. -- How much did the home team Hawthorn score?
SELECT "Home team score" FROM table_53982 WHERE "Home team" = 'hawthorn'
wikisql
CREATE TABLE table_name_40 ( year_s__won VARCHAR, total VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Year(s) Won, when Total is '145', and when Country is 'United States'?
SELECT year_s__won FROM table_name_40 WHERE total = 145 AND country = "united states"
sql_create_context
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '21485538' AND t_kc21.MED_SER_ORG_NO = '1900114') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE checking ( balance VARCHAR, custid VARCHAR ) CREATE TABLE savings ( balance VARCHAR, custid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the total checking and saving balance of all accounts sorted by the total balance in ascendi...
SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance
sql_create_context
CREATE TABLE gwyjzb ( 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 SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '7831592' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-06-23' AND '2019-12-27' UNION SELECT SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyj...
css
CREATE TABLE table_1676073_12 ( drawn VARCHAR, lost VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games drawn for the team that lost 11 and had 748 points?
SELECT drawn FROM table_1676073_12 WHERE lost = "11" AND points_for = "748"
sql_create_context
CREATE TABLE table_25261 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the song choice is Coba and the order number is 10, what is the result...
SELECT "Result" FROM table_25261 WHERE "Order #" = '10' AND "Song choice" = 'Coba'
wikisql
CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ) CREATE TABLE customers ( customer_id number, payment_method text, customer_name text, date_became_customer time, other_customer_details text ) CREATE TAB...
SELECT address_content FROM addresses WHERE city = "East Julianaside" AND state_province_county = "Texas" UNION SELECT address_content FROM addresses WHERE city = "Gleasonmouth" AND state_province_county = "Arizona"
spider
CREATE TABLE table_name_60 ( date_of_appointment VARCHAR, outgoing_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the appointment date for outgoing manager Petrik Sander?
SELECT date_of_appointment FROM table_name_60 WHERE outgoing_manager = "petrik sander"
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY MIN(Weight) DESC
nvbench
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 jyjgzbb ( JYZBLSH text, YLJGD...
SELECT zyjzjlb.JZLSH 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 = '22200311' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2021-07-01')
css
CREATE TABLE table_8036 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game played on December 17, with a H/A/N of H?
SELECT "Score" FROM table_8036 WHERE "H/A/N" = 'h' AND "Date" = 'december 17'
wikisql
CREATE TABLE table_32936 ( "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. -- Which venue hosted South Melbourne?
SELECT "Venue" FROM table_32936 WHERE "Away team" = 'south melbourne'
wikisql
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J...
css
CREATE TABLE table_30571 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many parts does detroit red wings person urban nordin pl...
SELECT COUNT("Position") FROM table_30571 WHERE "NHL team" = 'Detroit Red Wings' AND "Player" = 'Urban Nordin'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT 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 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '18542009470')
css
CREATE TABLE table_39573 ( "Score" text, "Opposition" text, "Venue" text, "City" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue had a city of Manchester before 2003?
SELECT "Venue" FROM table_39573 WHERE "City" = 'manchester' AND "Year" < '2003'
wikisql