instruction
stringlengths
0
1.06k
input
stringlengths
33
7.14k
response
stringlengths
2
4.44k
source
stringclasses
25 values
text
stringlengths
302
8.5k
What is the nation when gold is 0, bronze is more than 0 and rank is 16?
CREATE TABLE table_name_98 ( nation VARCHAR, rank VARCHAR, gold VARCHAR, bronze VARCHAR )
SELECT nation FROM table_name_98 WHERE gold = 0 AND bronze > 0 AND rank = "16"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the nation when gold is 0, bronze is more than 0 and rank is 16? ### Input: CREATE TABLE table_name_98 ( nation ...
What was the location of the fight when Sara McMann's record was 1-0?
CREATE TABLE table_name_42 ( location VARCHAR, record VARCHAR )
SELECT location FROM table_name_42 WHERE record = "1-0"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the location of the fight when Sara McMann's record was 1-0? ### Input: CREATE TABLE table_name_42 ( location V...
how many patient have died after they were diagnosed with hematological effect of infection - leukocytosis during the same hospital encounter until 2 years ago?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patient have died after they were diagnosed with hematological effect of infection - leukocytosis during the same h...
What is the 9:00 show that will be aired on the station that airs Dawson's Creek at 8:00?
CREATE TABLE table_35272 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text )
SELECT "9:00" FROM table_35272 WHERE "8:00" = 'dawson''s creek'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 9:00 show that will be aired on the station that airs Dawson's Creek at 8:00? ### Input: CREATE TABLE table_3527...
Who wrote 'Monica's bad day'?
CREATE TABLE table_29106 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer" text, "Original air date" text )
SELECT "Writer" FROM table_29106 WHERE "Title" = 'Monica''s Bad Day'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who wrote 'Monica's bad day'? ### Input: CREATE TABLE table_29106 ( "Series #" real, "Season #" real, "Title" te...
what number of irregular types are there ?
CREATE TABLE table_203_250 ( id number, "name" text, "type" text, "r.a. (j2000)" text, "dec. (j2000)" text, "redshift (km/s)" text, "apparent magnitude" number )
SELECT COUNT(*) FROM table_203_250 WHERE "type" = 'irregular'
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what number of irregular types are there ? ### Input: CREATE TABLE table_203_250 ( id number, "name" text, "type...
Suggested edits by a specific user.
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 Id AS "suggested_edit_link" FROM SuggestedEdits WHERE OwnerUserId = '##UserId##'
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Suggested edits by a specific user. ### Input: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
how many times did patient 021-196241 during this year go to the icu?
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 cost ( costid number, ...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-196241') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times did patient 021-196241 during this year go to the icu? ### Input: CREATE TABLE lab ( labid number, pa...
Give me a pie to show how many country from different country.
CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) 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 )
SELECT Country, COUNT(Country) FROM member GROUP BY Country
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a pie to show how many country from different country. ### Input: CREATE TABLE member ( Member_ID int, Name ...
hypotension requiring vasopressor therapy, despite fluid resuscitation of at least 30 cc / kg and lactate > 2 mmol / l
CREATE TABLE table_train_57 ( "id" int, "bleeding" int, "in_another_study" bool, "hiv_infection" bool, "hepatitis_c_infection" bool, "receiving_vasopressor" bool, "hypotension" bool, "NOUSE" float )
SELECT * FROM table_train_57 WHERE hypotension = 1 AND receiving_vasopressor = 1
criteria2sql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: hypotension requiring vasopressor therapy, despite fluid resuscitation of at least 30 cc / kg and lactate > 2 mmol / l ### I...
What is the title of the episode with production code 305?
CREATE TABLE table_26448179_4 ( title VARCHAR, production_code VARCHAR )
SELECT title FROM table_26448179_4 WHERE production_code = 305
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the title of the episode with production code 305? ### Input: CREATE TABLE table_26448179_4 ( title VARCHAR, ...
Find the payment method and phone of the party with email 'enrico09@example.com'.
CREATE TABLE organizations ( organization_id number, date_formed time, organization_name text, uk_vat_number text ) CREATE TABLE organization_contact_individuals ( individual_id number, organization_id number, date_contact_from time, date_contact_to time ) CREATE TABLE addresses ( ...
SELECT payment_method_code, party_phone FROM parties WHERE party_email = "enrico09@example.com"
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the payment method and phone of the party with email 'enrico09@example.com'. ### Input: CREATE TABLE organizations ( ...
What is the NBA draft result of the player from Dunbar High School?
CREATE TABLE table_58211 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
SELECT "NBA Draft" FROM table_58211 WHERE "School" = 'dunbar high school'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the NBA draft result of the player from Dunbar High School? ### Input: CREATE TABLE table_58211 ( "Player" text,...
What player belongs to Northwestern College?
CREATE TABLE table_name_34 ( player VARCHAR, college VARCHAR )
SELECT player FROM table_name_34 WHERE college = "northwestern"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What player belongs to Northwestern College? ### Input: CREATE TABLE table_name_34 ( player VARCHAR, college VARCHAR...
who was the opponent after hawthorn ?
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 )
SELECT "opponent" FROM table_204_881 WHERE id = (SELECT id FROM table_204_881 WHERE "opponent" = 'hawthorn') + 1
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who was the opponent after hawthorn ? ### Input: CREATE TABLE table_204_881 ( id number, "round" number, "date" ...
There were 68 worcs f-c matches played on Chester Road North Ground.
CREATE TABLE table_16891 ( "Name of ground" text, "Location" text, "First-class span" text, "Worcs f-c matches" real, "List A span" text, "Worcs LA matches" real )
SELECT "Worcs f-c matches" FROM table_16891 WHERE "Name of ground" = 'Chester Road North Ground'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: There were 68 worcs f-c matches played on Chester Road North Ground. ### Input: CREATE TABLE table_16891 ( "Name of grou...
what is the total number of locations in the city of algonac ?
CREATE TABLE table_204_558 ( id number, "name" text, "location" text, "city" text, "listing date" text )
SELECT COUNT("location") FROM table_204_558 WHERE "city" = 'algonac'
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total number of locations in the city of algonac ? ### Input: CREATE TABLE table_204_558 ( id number, "n...
In Summer 2003 , can I take GREEKMOD 505 ?
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In Summer 2003 , can I take GREEKMOD 505 ? ### Input: CREATE TABLE offering_instructor ( offering_instructor_id int, ...
i would like to find a flight from PITTSBURGH to BOSTON on wednesday and i have to be in BOSTON by one so i'd like a flight out of here no later than 1100
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE fare ( fare...
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 (((flight.arrival_time <= 1300 AND flight.departure_time <= 1100) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = ...
atis
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i would like to find a flight from PITTSBURGH to BOSTON on wednesday and i have to be in BOSTON by one so i'd like a flight ...
What are the course numbers Dr. William Gehring is teaching next semester ?
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%William Gehring%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
advising
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the course numbers Dr. William Gehring is teaching next semester ? ### Input: CREATE TABLE course_offering ( of...
How many o-19% are where the quartier is in saint-loup?
CREATE TABLE table_4223 ( "Quartier" text, "% 0-19 years" text, "% 20-39 years" text, "% 40-59 years" text, "% 60-74 years" text, "% 75 years and +" text )
SELECT "% 0-19 years" FROM table_4223 WHERE "Quartier" = 'Saint-Loup'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many o-19% are where the quartier is in saint-loup? ### Input: CREATE TABLE table_4223 ( "Quartier" text, "% 0-1...
how many singles did kitty wells release before 1952 ?
CREATE TABLE table_204_500 ( id number, "year" number, "title" text, "peak chart positions\nus country" number, "peak chart positions\nus" number, "album" text )
SELECT COUNT("title") FROM table_204_500 WHERE "year" < 1952
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many singles did kitty wells release before 1952 ? ### Input: CREATE TABLE table_204_500 ( id number, "year" num...
What position is Jeff Brown?
CREATE TABLE table_name_74 ( position VARCHAR, player VARCHAR )
SELECT position FROM table_name_74 WHERE player = "jeff brown"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What position is Jeff Brown? ### Input: CREATE TABLE table_name_74 ( position VARCHAR, player VARCHAR ) ### Response...
Tell me the goals for score of 38-28
CREATE TABLE table_name_54 ( goals VARCHAR, score VARCHAR )
SELECT goals FROM table_name_54 WHERE score = "38-28"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the goals for score of 38-28 ### Input: CREATE TABLE table_name_54 ( goals VARCHAR, score VARCHAR ) ### Resp...
who won more races , the usa or canada ?
CREATE TABLE table_204_48 ( id number, "date" text, "race name" text, "location" text, "uci rating" text, "winner" text, "team" text )
SELECT "winner" FROM table_204_48 WHERE "winner" IN ('usa', 'canada') GROUP BY "winner" ORDER BY COUNT(*) DESC LIMIT 1
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who won more races , the usa or canada ? ### Input: CREATE TABLE table_204_48 ( id number, "date" text, "race na...
What is the highest amount of group legs won when the prize money was 21,850?
CREATE TABLE table_26758 ( "Player" text, "Group Legs won" real, "Play-Off Legs won" real, "Winners Group Legs won" real, "Winners Play-Off Legs won" real, "Final position money won*" text, "Total money won" text )
SELECT MAX("Winners Group Legs won") FROM table_26758 WHERE "Total money won" = '£21,850'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest amount of group legs won when the prize money was 21,850? ### Input: CREATE TABLE table_26758 ( "Pla...
Average Reputation of SO Users n Manchester, United Kingdom.
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate ti...
SELECT AVG(Reputation) AS "average_reputation", COUNT(Id) AS "total_users" FROM Users WHERE LOWER(Location) LIKE '%manchester, united kingdom' AND Reputation > 1
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Average Reputation of SO Users n Manchester, United Kingdom. ### Input: CREATE TABLE ReviewTaskResults ( Id number, ...
Tell me the number of gold for albania with a silver of 1 and total less than 1
CREATE TABLE table_name_12 ( gold VARCHAR, total VARCHAR, silver VARCHAR, nation VARCHAR )
SELECT COUNT(gold) FROM table_name_12 WHERE silver = 1 AND nation = "albania" AND total < 1
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the number of gold for albania with a silver of 1 and total less than 1 ### Input: CREATE TABLE table_name_12 ( ...
How many patients born before the year 2094 have diagnosis short title anemia in chronic kidney disease?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2094" AND diagnoses.short_title = "Anemia in chr kidney dis"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients born before the year 2094 have diagnosis short title anemia in chronic kidney disease? ### Input: CREATE T...
What is the club that has the turkish basketball cup and fiba eurochallenge (3rd tier)?
CREATE TABLE table_55082 ( "Season" text, "Club" text, "National League" text, "National Cup" text, "European Cup" text )
SELECT "Club" FROM table_55082 WHERE "National Cup" = 'turkish basketball cup' AND "European Cup" = 'fiba eurochallenge (3rd tier)'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the club that has the turkish basketball cup and fiba eurochallenge (3rd tier)? ### Input: CREATE TABLE table_55082 ...
What is the population of Chimbote?
CREATE TABLE table_name_38 ( population INTEGER, name_of_city VARCHAR )
SELECT SUM(population) FROM table_name_38 WHERE name_of_city = "chimbote"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the population of Chimbote? ### Input: CREATE TABLE table_name_38 ( population INTEGER, name_of_city VARCHAR...
What was the winning score in 1980?
CREATE TABLE table_name_51 ( winning_score VARCHAR, year VARCHAR )
SELECT winning_score FROM table_name_51 WHERE year = 1980
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the winning score in 1980? ### Input: CREATE TABLE table_name_51 ( winning_score VARCHAR, year VARCHAR ) ##...
Show each premise type and the number of premises in that type.
CREATE TABLE premises ( premises_type VARCHAR )
SELECT premises_type, COUNT(*) FROM premises GROUP BY premises_type
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show each premise type and the number of premises in that type. ### Input: CREATE TABLE premises ( premises_type VARCHAR...
How many questions & answers last edited by Mat(635608) in a time range.
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 PostHistoryTypes ( Id number, Name te...
SELECT COUNT(*) FROM Posts WHERE LastEditorUserId = 635608 AND OwnerUserId != 635608 AND LastEditDate > '2013-05-03 12:00:00 AM'
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many questions & answers last edited by Mat(635608) in a time range. ### Input: CREATE TABLE TagSynonyms ( Id number...
What is the total number of positions having 1 loss and more than 9 conceded?
CREATE TABLE table_14062 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
SELECT COUNT("Position") FROM table_14062 WHERE "Losses" = '1' AND "Conceded" > '9'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of positions having 1 loss and more than 9 conceded? ### Input: CREATE TABLE table_14062 ( "Pos...
Who is the chairman of Mark Robins team?
CREATE TABLE table_3594 ( "Team" text, "Manager" text, "Chairman" text, "Team captain" text, "Kit maker" text, "Sponsor" text )
SELECT "Chairman" FROM table_3594 WHERE "Manager" = 'Mark Robins'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the chairman of Mark Robins team? ### Input: CREATE TABLE table_3594 ( "Team" text, "Manager" text, "Chai...
Which Land area (km ) has a Population density (per km ) larger than 112.6, and a Population (2006) larger than 785, and a Name of pinehouse?
CREATE TABLE table_62794 ( "Name" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" real, "Land area (km\u00b2)" real, "Population density (per km\u00b2)" real )
SELECT MAX("Land area (km\u00b2)") FROM table_62794 WHERE "Population density (per km\u00b2)" > '112.6' AND "Population (2006)" > '785' AND "Name" = 'pinehouse'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Land area (km ) has a Population density (per km ) larger than 112.6, and a Population (2006) larger than 785, and a N...
what percentile is red blood cells 3.61 among patients of the same age as patient 15209 during their current hospital visit?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime ti...
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissio...
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what percentile is red blood cells 3.61 among patients of the same age as patient 15209 during their current hospital visit?...
how many times did patient 005-46456 receive surgery consultation in 2104?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND treatment.treatmentname = 'surgery consultation' AND STRFTIME('...
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times did patient 005-46456 receive surgery consultation in 2104? ### Input: CREATE TABLE treatment ( treatment...
What record has montreal, qc as the location, with boston bruins as the visitor?
CREATE TABLE table_name_14 ( record VARCHAR, location VARCHAR, visitor VARCHAR )
SELECT record FROM table_name_14 WHERE location = "montreal, qc" AND visitor = "boston bruins"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What record has montreal, qc as the location, with boston bruins as the visitor? ### Input: CREATE TABLE table_name_14 ( ...
Find coincident activity between two users.
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
WITH Interesting(UserId) AS (SELECT 342852 UNION ALL SELECT 57611) SELECT PostId = p.Id, QuestionId = COALESCE(a.Id, p.Id), AnswerId = CASE WHEN p.PostTypeId = 2 THEN p.Id ELSE NULL END FROM Posts AS p LEFT JOIN Posts AS a ON p.PostTypeId = 2 AND p.ParentId = a.Id WHERE EXISTS(SELECT * FROM Interesting AS i WHERE p.Own...
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find coincident activity between two users. ### Input: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, ...
how many patients with primary disease bowel obstruction died in or before 2174?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.dod_year <= "2174.0"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients with primary disease bowel obstruction died in or before 2174? ### Input: CREATE TABLE demographic ( s...
Name the memory for meodel number for atom e640t
CREATE TABLE table_21020 ( "Model number" text, "sSpec number" text, "Frequency" text, "GPU frequency" text, "L2 cache" text, "I/O bus" text, "Memory" text, "Voltage" text, "TDP" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" ...
SELECT "Memory" FROM table_21020 WHERE "Model number" = 'Atom E640T'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the memory for meodel number for atom e640t ### Input: CREATE TABLE table_21020 ( "Model number" text, "sSpec n...
Visualize a bar chart for how many students play each sport?, and show total number from low to high order.
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 Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER ) CREATE TABLE Video_Games ( Ga...
SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*)
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart for how many students play each sport?, and show total number from low to high order. ### Input: CREAT...
how many patients have anemia in chronic kidney disease as their diagnosis long title?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Anemia in chronic kidney disease"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients have anemia in chronic kidney disease as their diagnosis long title? ### Input: CREATE TABLE prescriptions...
What is the Game site week 1?
CREATE TABLE table_77441 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game site" text )
SELECT "Game site" FROM table_77441 WHERE "Week" = '1'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Game site week 1? ### Input: CREATE TABLE table_77441 ( "Week" real, "Date" text, "Opponent" text, ...
What is the rank where the gold is 0?
CREATE TABLE table_name_70 ( rank INTEGER, gold INTEGER )
SELECT AVG(rank) FROM table_name_70 WHERE gold < 0
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the rank where the gold is 0? ### Input: CREATE TABLE table_name_70 ( rank INTEGER, gold INTEGER ) ### Respo...
What was the sample size for the poll from Nov 9-11, 2007 with a margin of error less than 4.3?
CREATE TABLE table_name_72 ( sample_size INTEGER, date VARCHAR, margin_of_error VARCHAR )
SELECT MAX(sample_size) FROM table_name_72 WHERE date = "nov 9-11, 2007" AND margin_of_error < 4.3
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the sample size for the poll from Nov 9-11, 2007 with a margin of error less than 4.3? ### Input: CREATE TABLE tabl...
what is patient 22295's yearly maximum level of glucose?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22295) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') GROUP BY STRFTIME('%y', labevents.charttime)
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is patient 22295's yearly maximum level of glucose? ### Input: CREATE TABLE inputevents_cv ( row_id number, sub...
What is the score for Billy Andrade?
CREATE TABLE table_name_73 ( score VARCHAR, player VARCHAR )
SELECT score FROM table_name_73 WHERE player = "billy andrade"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score for Billy Andrade? ### Input: CREATE TABLE table_name_73 ( score VARCHAR, player VARCHAR ) ### Res...
Which IHSAA class has a mascot of the Raiders?
CREATE TABLE table_64419 ( "School" text, "Location" text, "Mascot" text, "Size" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text )
SELECT "IHSAA Class" FROM table_64419 WHERE "Mascot" = 'raiders'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which IHSAA class has a mascot of the Raiders? ### Input: CREATE TABLE table_64419 ( "School" text, "Location" text,...
How many under the category of Against have a Difference of 11
CREATE TABLE table_20032 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won" real, "Drawn" real, "Lost" real, "For" real, "Against" real, "Difference" real )
SELECT COUNT("Against") FROM table_20032 WHERE "Difference" = '11'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many under the category of Against have a Difference of 11 ### Input: CREATE TABLE table_20032 ( "Position" real, ...
Users by Downvotes (top 100).
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, ...
SELECT * FROM Users ORDER BY DownVotes DESC LIMIT 100
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Users by Downvotes (top 100). ### Input: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, U...
what's the game with date being march 7
CREATE TABLE table_18820 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Game" FROM table_18820 WHERE "Date" = 'March 7'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the game with date being march 7 ### Input: CREATE TABLE table_18820 ( "Game" real, "Date" text, "Team" t...
what are the four most frequently ordered laboratory tests for patients of age 20s?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) GROUP BY labevents.itemid) AS ...
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most frequently ordered laboratory tests for patients of age 20s? ### Input: CREATE TABLE procedures_icd (...
What's the 1949/50 expenditure (in $ millions) in the country where the 1948/49 expenditure was 232$ millions?
CREATE TABLE table_2155 ( "Country" text, "1948/49 ($ millions)" real, "1949/50 ($ millions)" real, "1950/51 ($ millions)" real, "Cumulative ($ millions)" real )
SELECT MAX("1949/50 ($ millions)") FROM table_2155 WHERE "1948/49 ($ millions)" = '232'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the 1949/50 expenditure (in $ millions) in the country where the 1948/49 expenditure was 232$ millions? ### Input: CR...
What is the number of patients who died on or before 2148 that had complete heart block as their primary disease?
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 = "COMPLETE HEART BLOCK" AND demographic.dod_year <= "2148.0"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of patients who died on or before 2148 that had complete heart block as their primary disease? ### Input:...
what were the five most frequent drugs that were prescribed within 2 months to the hypotension / pressor dependent female patients with age 30s after they have been diagnosed with hypotension / pressor dependent, this year?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, ...
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 = 'hypotension / pressor dependent' AND DATETIME(diag...
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the five most frequent drugs that were prescribed within 2 months to the hypotension / pressor dependent female pa...
Who is the second member more recently than 1790 when John Williams is the first member?
CREATE TABLE table_name_10 ( second_member VARCHAR, year VARCHAR, first_member VARCHAR )
SELECT second_member FROM table_name_10 WHERE year > 1790 AND first_member = "john williams"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the second member more recently than 1790 when John Williams is the first member? ### Input: CREATE TABLE table_name_...
Name the miles for june 7
CREATE TABLE table_16493961_1 ( miles__km_ VARCHAR, date VARCHAR )
SELECT miles__km_ FROM table_16493961_1 WHERE date = "June 7"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the miles for june 7 ### Input: CREATE TABLE table_16493961_1 ( miles__km_ VARCHAR, date VARCHAR ) ### Response...
Anthony West ride which Motorcyle?
CREATE TABLE table_67166 ( "Team" text, "Constructor" text, "Motorcycle" text, "Tyre" text, "Rider" text, "Rounds" text )
SELECT "Motorcycle" FROM table_67166 WHERE "Rider" = 'anthony west'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Anthony West ride which Motorcyle? ### Input: CREATE TABLE table_67166 ( "Team" text, "Constructor" text, "Motor...
How many entries arr there for the top 10 for the 78th position?
CREATE TABLE table_1507423_5 ( top_10 VARCHAR, position VARCHAR )
SELECT COUNT(top_10) FROM table_1507423_5 WHERE position = "78th"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many entries arr there for the top 10 for the 78th position? ### Input: CREATE TABLE table_1507423_5 ( top_10 VARCHA...
What is the mean year number where there are more than 0 wins, the class is 250cc, and the points are 95?
CREATE TABLE table_74984 ( "Year" real, "Class" text, "Team" text, "Points" real, "Wins" real )
SELECT AVG("Year") FROM table_74984 WHERE "Wins" > '0' AND "Class" = '250cc' AND "Points" = '95'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the mean year number where there are more than 0 wins, the class is 250cc, and the points are 95? ### Input: CREATE ...
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, could you sort X from high to low order please?
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the sum of m...
what is id of students who registered some courses but the least number of courses in these students?
CREATE TABLE candidates ( candidate_id number, candidate_details text ) CREATE TABLE people_addresses ( person_address_id number, person_id number, address_id number, date_from time, date_to time ) CREATE TABLE candidate_assessments ( candidate_id number, qualification text, as...
SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY COUNT(*) LIMIT 1
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is id of students who registered some courses but the least number of courses in these students? ### Input: CREATE TABL...
what is the name of the drug prescribed to patient 66015 in the same hospital encounter after having been diagnosed with hypertension nos during the last month?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, ...
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 66015 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s...
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the name of the drug prescribed to patient 66015 in the same hospital encounter after having been diagnosed with hyp...
How many players were 6'1' and from Columbia, South Carolina?
CREATE TABLE table_72574 ( "Position" text, "Number" real, "Name" text, "Height" text, "Weight" text, "Class" text, "Hometown" text, "Games\u2191" real )
SELECT COUNT("Position") FROM table_72574 WHERE "Height" = '6''1' AND "Hometown" = 'Columbia, South Carolina'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many players were 6'1' and from Columbia, South Carolina? ### Input: CREATE TABLE table_72574 ( "Position" text, ...
what is the only model of these aircraft to originate in canada ?
CREATE TABLE table_204_710 ( id number, "model" text, "origin" text, "type" text, "versions" text, "in service" text, "notes" text )
SELECT "model" FROM table_204_710 WHERE "origin" = 'canada'
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the only model of these aircraft to originate in canada ? ### Input: CREATE TABLE table_204_710 ( id number, ...
What are the census ranking(s) for a population of 284?
CREATE TABLE table_21370 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text )
SELECT "Census Ranking" FROM table_21370 WHERE "Population" = '284'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the census ranking(s) for a population of 284? ### Input: CREATE TABLE table_21370 ( "Official Name" text, ...
What is the original title of the film from Japan/Taiwan before 2003?
CREATE TABLE table_71643 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Director(s)" text )
SELECT "Original title" FROM table_71643 WHERE "Year" < '2003' AND "Country" = 'japan/taiwan'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the original title of the film from Japan/Taiwan before 2003? ### Input: CREATE TABLE table_71643 ( "Year" real,...
Find the minimum gpa of all students in each department with a pie chart.
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int...
SELECT DEPT_CODE, MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the minimum gpa of all students in each department with a pie chart. ### Input: CREATE TABLE PROFESSOR ( EMP_NUM in...
Give me a bar chart for the total number of each budget type code, and rank from high to low by the X please.
CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses...
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY Budget_Type_Code DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a bar chart for the total number of each budget type code, and rank from high to low by the X please. ### Input: CRE...
what is the declination (j2000) when the ngc number is higher than 3593?
CREATE TABLE table_58453 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text )
SELECT "Declination ( J2000 )" FROM table_58453 WHERE "NGC number" > '3593'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the declination (j2000) when the ngc number is higher than 3593? ### Input: CREATE TABLE table_58453 ( "NGC numb...
What was the payout in US dollars at the Insight Bowl?
CREATE TABLE table_41012 ( "Bowl Game" text, "Date" text, "Stadium" text, "City" text, "Television" text, "Conference Matchups" text, "Payout ( US$ )" text )
SELECT "Payout ( US$ )" FROM table_41012 WHERE "Bowl Game" = 'insight bowl'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the payout in US dollars at the Insight Bowl? ### Input: CREATE TABLE table_41012 ( "Bowl Game" text, "Date...
Plot the average of budget in billions over creation in a line chart, and order by the Creation in descending.
CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE management ( department_ID int, head_ID int, tempor...
SELECT Creation, AVG(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Plot the average of budget in billions over creation in a line chart, and order by the Creation in descending. ### Input: CR...
How many program data on Asia was written if the organization launched 14 programs iin the Americas?
CREATE TABLE table_29354 ( "Programs" text, "World" real, "Africa" real, "Americas" real, "Asia" real, "Australasia" real, "Europe" real )
SELECT COUNT("Asia") FROM table_29354 WHERE "Americas" = '14'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many program data on Asia was written if the organization launched 14 programs iin the Americas? ### Input: CREATE TABLE...
What was the score of the game on October 20 when the home team is the NY Islanders?
CREATE TABLE table_name_57 ( score VARCHAR, home VARCHAR, date VARCHAR )
SELECT score FROM table_name_57 WHERE home = "ny islanders" AND date = "october 20"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the game on October 20 when the home team is the NY Islanders? ### Input: CREATE TABLE table_name_57 (...
What was the table position for the team whose outgoing manager was Brian Laws?
CREATE TABLE table_28800 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Position in table" text, "Incoming manager" text, "Date of appointment" text )
SELECT "Position in table" FROM table_28800 WHERE "Outgoing manager" = 'Brian Laws'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the table position for the team whose outgoing manager was Brian Laws? ### Input: CREATE TABLE table_28800 ( "T...
Which Tournament has a Surface of carpet, and a Date smaller than 1995, and an Opponent in the final of ken flach robert seguso?
CREATE TABLE table_50089 ( "Date" real, "Tournament" text, "Surface" text, "Partnering" text, "Opponent in the final" text, "Score" text )
SELECT "Tournament" FROM table_50089 WHERE "Surface" = 'carpet' AND "Date" < '1995' AND "Opponent in the final" = 'ken flach robert seguso'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Tournament has a Surface of carpet, and a Date smaller than 1995, and an Opponent in the final of ken flach robert seg...
What's 's romanised name?
CREATE TABLE table_25184 ( "Romanised name" text, "Chinese name" text, "age at appointment" real, "Portfolio" text, "Prior occupation" text )
SELECT "Romanised name" FROM table_25184 WHERE "Chinese name" = '梁愛詩'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's 's romanised name? ### Input: CREATE TABLE table_25184 ( "Romanised name" text, "Chinese name" text, "age...
What are all the instruments used?
CREATE TABLE Instruments ( instrument VARCHAR )
SELECT DISTINCT instrument FROM Instruments
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are all the instruments used? ### Input: CREATE TABLE Instruments ( instrument VARCHAR ) ### Response: SELECT DISTI...
What type of game had a 0:0 result?
CREATE TABLE table_name_17 ( type_of_game VARCHAR, results¹ VARCHAR )
SELECT type_of_game FROM table_name_17 WHERE results¹ = "0:0"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What type of game had a 0:0 result? ### Input: CREATE TABLE table_name_17 ( type_of_game VARCHAR, results¹ VARCHAR )...
what was the venue when he placed first ?
CREATE TABLE table_204_706 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
SELECT "venue" FROM table_204_706 WHERE "position" = 1
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the venue when he placed first ? ### Input: CREATE TABLE table_204_706 ( id number, "year" number, "com...
Rust questions per day averaged over weeks (2018).
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 SuggestedEdits ( Id number, PostId number, CreationD...
SELECT MIN(Posts.CreationDate), COUNT(*) / 7.0 AS "posts per day" FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE Tags.TagName = 'rust' AND Posts.CreationDate > '2018-01-01' GROUP BY TIME_TO_STR(Posts.CreationDate, '%W'), TIME_TO_STR(Posts.CreationDate, '%Y...
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Rust questions per day averaged over weeks (2018). ### Input: CREATE TABLE PostHistory ( Id number, PostHistoryTypeI...
how much weight was patient 013-29301's last weight on their first hospital visit?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-29301' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY p...
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much weight was patient 013-29301's last weight on their first hospital visit? ### Input: CREATE TABLE vitalperiodic ( ...
What is the 2003 statistic for general cargo?
CREATE TABLE table_name_94 ( product VARCHAR )
SELECT 2003 FROM table_name_94 WHERE product = "general cargo"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 2003 statistic for general cargo? ### Input: CREATE TABLE table_name_94 ( product VARCHAR ) ### Response: SE...
What home team played Collingwood as the away team?
CREATE TABLE table_55738 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team" FROM table_55738 WHERE "Away team" = 'collingwood'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What home team played Collingwood as the away team? ### Input: CREATE TABLE table_55738 ( "Home team" text, "Home te...
Where was the Fury FC 4: High Voltage event held?
CREATE TABLE table_44653 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
SELECT "Location" FROM table_44653 WHERE "Event" = 'fury fc 4: high voltage'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where was the Fury FC 4: High Voltage event held? ### Input: CREATE TABLE table_44653 ( "Res." text, "Record" text, ...
what is the number of patients whose marital status is divorced and admission year is less than 2151?
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 WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2151"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose marital status is divorced and admission year is less than 2151? ### Input: CREATE TABL...
On what date did Jesse Levine play on a hard surface?
CREATE TABLE table_name_78 ( date VARCHAR, surface VARCHAR, opponent VARCHAR )
SELECT date FROM table_name_78 WHERE surface = "hard" AND opponent = "jesse levine"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date did Jesse Levine play on a hard surface? ### Input: CREATE TABLE table_name_78 ( date VARCHAR, surface ...
What is the model that was made in the years 2011 2012-?
CREATE TABLE table_63380 ( "Model" text, "Years" text, "Engine code" text, "Power" text, "Torque" text )
SELECT "Model" FROM table_63380 WHERE "Years" = '2011 2012-'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the model that was made in the years 2011 2012-? ### Input: CREATE TABLE table_63380 ( "Model" text, "Years"...
What is the highest rank of the player with less than 32 points?
CREATE TABLE table_41871 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Points" real )
SELECT MAX("Rank") FROM table_41871 WHERE "Points" < '32'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest rank of the player with less than 32 points? ### Input: CREATE TABLE table_41871 ( "Rank" real, ...
Return the characters and durations for each actor.
CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text ) CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number )
SELECT character, duration FROM actor
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the characters and durations for each actor. ### Input: CREATE TABLE musical ( musical_id number, name text, ...
What was the result of the game on December 22, 1991?
CREATE TABLE table_74787 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Result" FROM table_74787 WHERE "Date" = 'december 22, 1991'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result of the game on December 22, 1991? ### Input: CREATE TABLE table_74787 ( "Week" real, "Date" text...
What record has a december less than 6, points less than 38, and pittsburgh penguins as the opponent?
CREATE TABLE table_5675 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
SELECT "Record" FROM table_5675 WHERE "December" < '6' AND "Points" < '38' AND "Opponent" = 'pittsburgh penguins'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What record has a december less than 6, points less than 38, and pittsburgh penguins as the opponent? ### Input: CREATE TABL...
What is the largest 6-car-sets for fiscal year 1968?
CREATE TABLE table_19255192_1 ( fiscal_year VARCHAR )
SELECT MAX(6 AS _car_sets) FROM table_19255192_1 WHERE fiscal_year = 1968
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest 6-car-sets for fiscal year 1968? ### Input: CREATE TABLE table_19255192_1 ( fiscal_year VARCHAR ) ##...
Who is team c when dhez javier is team e?
CREATE TABLE table_name_44 ( team_c VARCHAR, team_e VARCHAR )
SELECT team_c FROM table_name_44 WHERE team_e = "dhez javier"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is team c when dhez javier is team e? ### Input: CREATE TABLE table_name_44 ( team_c VARCHAR, team_e VARCHAR ) #...
How many courses are offered?
CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu_phone text, prof_num number ) CREATE TABLE enroll ( class_code text, stu_n...
SELECT COUNT(DISTINCT crs_code) FROM class
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many courses are offered? ### Input: CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, ...
Draw a bar chart for how many different locations does each school have?, order from low to high by the y-axis.
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CR...
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT ORDER BY COUNT(DISTINCT DEPT_ADDRESS)
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart for how many different locations does each school have?, order from low to high by the y-axis. ### Input: C...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by time, I want to order by the Y-axis in ascending please.
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID)
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date...