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 number of votes when Ron Paul is the candidate with less than 0 counties?
|
CREATE TABLE table_40175 (
"Candidate" text,
"Votes" real,
"Percentage" text,
"Counties" real,
"Delegates" real
)
|
SELECT COUNT("Votes") FROM table_40175 WHERE "Candidate" = 'ron paul' AND "Counties" < '0'
|
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 number of votes when Ron Paul is the candidate with less than 0 counties? ### Input: CREATE TABLE table_40175 (
"Candidate" text,
"Votes" real,
"Percentage" text,
"Counties" real,
"Delegates" real
) ### Response: SELECT COUNT("Votes") FROM table_40175 WHERE "Candidate" = 'ron paul' AND "Counties" < '0'
|
what is the total amount of times porsche is a constructor ?
|
CREATE TABLE table_203_406 (
id number,
"entrant" text,
"constructor" text,
"chassis" text,
"engine" text,
"tyre" text,
"driver" text,
"rounds" text
)
|
SELECT COUNT(DISTINCT "entrant") FROM table_203_406 WHERE "constructor" = 'porsche'
|
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 amount of times porsche is a constructor ? ### Input: CREATE TABLE table_203_406 (
id number,
"entrant" text,
"constructor" text,
"chassis" text,
"engine" text,
"tyre" text,
"driver" text,
"rounds" text
) ### Response: SELECT COUNT(DISTINCT "entrant") FROM table_203_406 WHERE "constructor" = 'porsche'
|
What title episode did Paris Barclay direct?
|
CREATE TABLE table_20726262_2 (
title VARCHAR,
directedby VARCHAR
)
|
SELECT title FROM table_20726262_2 WHERE directedby = "Paris Barclay"
|
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 title episode did Paris Barclay direct? ### Input: CREATE TABLE table_20726262_2 (
title VARCHAR,
directedby VARCHAR
) ### Response: SELECT title FROM table_20726262_2 WHERE directedby = "Paris Barclay"
|
Show me about the distribution of date_address_to and the sum of monthly_rental bin date_address_to by time in a bar chart.
|
CREATE TABLE Students (
student_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
date_first_rental DATETIME,
date_left_university DATETIME,
other_student_details VARCHAR(255)
)
CREATE TABLE Student_Addresses (
student_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
date_address_to DATETIME,
monthly_rental DECIMAL(19,4),
other_details VARCHAR(255)
)
CREATE TABLE Assessment_Notes (
notes_id INTEGER,
student_id INTEGER,
teacher_id INTEGER,
date_of_notes DATETIME,
text_of_notes VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3 VARCHAR(120),
city VARCHAR(80),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50),
other_address_details VARCHAR(255)
)
CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHAR(10),
incident_type_description VARCHAR(80)
)
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Behavior_Incident (
incident_id INTEGER,
incident_type_code VARCHAR(10),
student_id INTEGER,
date_incident_start DATETIME,
date_incident_end DATETIME,
incident_summary VARCHAR(255),
recommendations VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
teacher_id INTEGER,
datetime_detention_start DATETIME,
datetime_detention_end DATETIME,
detention_summary VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Detention_Type (
detention_type_code VARCHAR(10),
detention_type_description VARCHAR(80)
)
|
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental 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: Show me about the distribution of date_address_to and the sum of monthly_rental bin date_address_to by time in a bar chart. ### Input: CREATE TABLE Students (
student_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
date_first_rental DATETIME,
date_left_university DATETIME,
other_student_details VARCHAR(255)
)
CREATE TABLE Student_Addresses (
student_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
date_address_to DATETIME,
monthly_rental DECIMAL(19,4),
other_details VARCHAR(255)
)
CREATE TABLE Assessment_Notes (
notes_id INTEGER,
student_id INTEGER,
teacher_id INTEGER,
date_of_notes DATETIME,
text_of_notes VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3 VARCHAR(120),
city VARCHAR(80),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50),
other_address_details VARCHAR(255)
)
CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHAR(10),
incident_type_description VARCHAR(80)
)
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Behavior_Incident (
incident_id INTEGER,
incident_type_code VARCHAR(10),
student_id INTEGER,
date_incident_start DATETIME,
date_incident_end DATETIME,
incident_summary VARCHAR(255),
recommendations VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
teacher_id INTEGER,
datetime_detention_start DATETIME,
datetime_detention_end DATETIME,
detention_summary VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Detention_Type (
detention_type_code VARCHAR(10),
detention_type_description VARCHAR(80)
) ### Response: SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
|
How many seasons featured 29 conversions?
|
CREATE TABLE table_23734 (
"Season" text,
"Games" real,
"Tries" real,
"Conversions" real,
"Penalties" real,
"Drop Goals" real,
"Total Points" real
)
|
SELECT COUNT("Penalties") FROM table_23734 WHERE "Conversions" = '29'
|
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 seasons featured 29 conversions? ### Input: CREATE TABLE table_23734 (
"Season" text,
"Games" real,
"Tries" real,
"Conversions" real,
"Penalties" real,
"Drop Goals" real,
"Total Points" real
) ### Response: SELECT COUNT("Penalties") FROM table_23734 WHERE "Conversions" = '29'
|
How many episodes were directed by Sarah Pia Anderson?
|
CREATE TABLE table_25896 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
|
SELECT COUNT("Title") FROM table_25896 WHERE "Directed by" = 'Sarah Pia Anderson'
|
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 episodes were directed by Sarah Pia Anderson? ### Input: CREATE TABLE table_25896 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) ### Response: SELECT COUNT("Title") FROM table_25896 WHERE "Directed by" = 'Sarah Pia Anderson'
|
Plot how many date in location from over date in location from in a line chart, and list by the X from low to high.
|
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
|
SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Date_in_Location_From ORDER BY Date_in_Location_From
|
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 how many date in location from over date in location from in a line chart, and list by the X from low to high. ### Input: CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
) ### Response: SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Date_in_Location_From ORDER BY Date_in_Location_From
|
How many players scored the most points on game 4?
|
CREATE TABLE table_13762472_3 (
high_points VARCHAR,
game VARCHAR
)
|
SELECT COUNT(high_points) FROM table_13762472_3 WHERE game = 4
|
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 players scored the most points on game 4? ### Input: CREATE TABLE table_13762472_3 (
high_points VARCHAR,
game VARCHAR
) ### Response: SELECT COUNT(high_points) FROM table_13762472_3 WHERE game = 4
|
How many years of NBA experience does the player who plays position g for the Portland Trail Blazers?
|
CREATE TABLE table_76759 (
"Player" text,
"Pos." text,
"Nationality" text,
"Team" text,
"Previous team" text,
"Years of NBA experience [a ]" real,
"Career with the franchise [b ]" text
)
|
SELECT "Years of NBA experience [a ]" FROM table_76759 WHERE "Pos." = 'g' AND "Team" = 'portland trail blazers'
|
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 years of NBA experience does the player who plays position g for the Portland Trail Blazers? ### Input: CREATE TABLE table_76759 (
"Player" text,
"Pos." text,
"Nationality" text,
"Team" text,
"Previous team" text,
"Years of NBA experience [a ]" real,
"Career with the franchise [b ]" text
) ### Response: SELECT "Years of NBA experience [a ]" FROM table_76759 WHERE "Pos." = 'g' AND "Team" = 'portland trail blazers'
|
For each state, find the total account balance of customers whose credit score is above 100.
|
CREATE TABLE customer (
state VARCHAR,
acc_bal INTEGER,
credit_score INTEGER
)
|
SELECT SUM(acc_bal), state FROM customer WHERE credit_score > 100 GROUP BY state
|
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: For each state, find the total account balance of customers whose credit score is above 100. ### Input: CREATE TABLE customer (
state VARCHAR,
acc_bal INTEGER,
credit_score INTEGER
) ### Response: SELECT SUM(acc_bal), state FROM customer WHERE credit_score > 100 GROUP BY state
|
What was the 2nd leg score if the team 1 is Deportivo Pasto?
|
CREATE TABLE table_3806 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
)
|
SELECT "2nd leg" FROM table_3806 WHERE "Team #1" = 'Deportivo Pasto'
|
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 2nd leg score if the team 1 is Deportivo Pasto? ### Input: CREATE TABLE table_3806 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) ### Response: SELECT "2nd leg" FROM table_3806 WHERE "Team #1" = 'Deportivo Pasto'
|
When Giovanni Gaetano Orsini was the elector who was the elevator?
|
CREATE TABLE table_name_63 (
elevator VARCHAR,
elector VARCHAR
)
|
SELECT elevator FROM table_name_63 WHERE elector = "giovanni gaetano orsini"
|
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: When Giovanni Gaetano Orsini was the elector who was the elevator? ### Input: CREATE TABLE table_name_63 (
elevator VARCHAR,
elector VARCHAR
) ### Response: SELECT elevator FROM table_name_63 WHERE elector = "giovanni gaetano orsini"
|
Which Bronze has a Silver larger than 1, a Total larger than 3, a Nation of turkey, and a Gold smaller than 2?
|
CREATE TABLE table_name_53 (
bronze INTEGER,
gold VARCHAR,
nation VARCHAR,
silver VARCHAR,
total VARCHAR
)
|
SELECT SUM(bronze) FROM table_name_53 WHERE silver > 1 AND total > 3 AND nation = "turkey" AND gold < 2
|
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: Which Bronze has a Silver larger than 1, a Total larger than 3, a Nation of turkey, and a Gold smaller than 2? ### Input: CREATE TABLE table_name_53 (
bronze INTEGER,
gold VARCHAR,
nation VARCHAR,
silver VARCHAR,
total VARCHAR
) ### Response: SELECT SUM(bronze) FROM table_name_53 WHERE silver > 1 AND total > 3 AND nation = "turkey" AND gold < 2
|
What is the Election date for Member william richmond category:articles with hcards?
|
CREATE TABLE table_31590 (
"Member" text,
"Electorate" text,
"Province" text,
"MP's term" text,
"Election date" text
)
|
SELECT "Election date" FROM table_31590 WHERE "Member" = 'william richmond category:articles with hcards'
|
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 Election date for Member william richmond category:articles with hcards? ### Input: CREATE TABLE table_31590 (
"Member" text,
"Electorate" text,
"Province" text,
"MP's term" text,
"Election date" text
) ### Response: SELECT "Election date" FROM table_31590 WHERE "Member" = 'william richmond category:articles with hcards'
|
find me paper on using Neural for Relation Extraction
|
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
|
SELECT DISTINCT paperkeyphrase.paperid FROM keyphrase, paperkeyphrase WHERE keyphrase.keyphrasename IN ('Neural', 'Relation Extraction') GROUP BY paperkeyphrase.paperid HAVING COUNT(DISTINCT keyphrase.keyphraseid) = 1
|
scholar
|
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 me paper on using Neural for Relation Extraction ### Input: CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
) ### Response: SELECT DISTINCT paperkeyphrase.paperid FROM keyphrase, paperkeyphrase WHERE keyphrase.keyphrasename IN ('Neural', 'Relation Extraction') GROUP BY paperkeyphrase.paperid HAVING COUNT(DISTINCT keyphrase.keyphraseid) = 1
|
For those employees who was hired before 2002-06-21, a line chart shows the change of commission_pct over hire_date, and I want to display in desc by the x-axis.
|
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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
|
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE 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, a line chart shows the change of commission_pct over hire_date, and I want to display in desc by the x-axis. ### Input: 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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
) ### Response: SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC
|
What is the total crowd size when the away team scores 14.6 (90)?
|
CREATE TABLE table_33085 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
|
SELECT SUM("Crowd") FROM table_33085 WHERE "Away team score" = '14.6 (90)'
|
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 crowd size when the away team scores 14.6 (90)? ### Input: CREATE TABLE table_33085 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) ### Response: SELECT SUM("Crowd") FROM table_33085 WHERE "Away team score" = '14.6 (90)'
|
What was the score of the game for April 16?
|
CREATE TABLE table_name_62 (
loss VARCHAR,
date VARCHAR
)
|
SELECT loss FROM table_name_62 WHERE date = "april 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 was the score of the game for April 16? ### Input: CREATE TABLE table_name_62 (
loss VARCHAR,
date VARCHAR
) ### Response: SELECT loss FROM table_name_62 WHERE date = "april 16"
|
For those records from the products and each product's manufacturer, what is the relationship between code and code , and group by attribute founder?
|
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
)
|
SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
|
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 records from the products and each product's manufacturer, what is the relationship between code and code , and group by attribute founder? ### Input: 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
) ### Response: SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
|
What are the names of all tracks that are on playlists titled Movies?
|
CREATE TABLE genres (
id number,
name text
)
CREATE TABLE media_types (
id number,
name text
)
CREATE TABLE customers (
id number,
first_name text,
last_name text,
company text,
address text,
city text,
state text,
country text,
postal_code text,
phone text,
fax text,
email text,
support_rep_id number
)
CREATE TABLE employees (
id number,
last_name text,
first_name text,
title text,
reports_to number,
birth_date time,
hire_date time,
address text,
city text,
state text,
country text,
postal_code text,
phone text,
fax text,
email text
)
CREATE TABLE albums (
id number,
title text,
artist_id number
)
CREATE TABLE tracks (
id number,
name text,
album_id number,
media_type_id number,
genre_id number,
composer text,
milliseconds number,
bytes number,
unit_price number
)
CREATE TABLE invoices (
id number,
customer_id number,
invoice_date time,
billing_address text,
billing_city text,
billing_state text,
billing_country text,
billing_postal_code text,
total number
)
CREATE TABLE invoice_lines (
id number,
invoice_id number,
track_id number,
unit_price number,
quantity number
)
CREATE TABLE sqlite_sequence (
name text,
seq text
)
CREATE TABLE artists (
id number,
name text
)
CREATE TABLE playlists (
id number,
name text
)
CREATE TABLE playlist_tracks (
playlist_id number,
track_id number
)
|
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies"
|
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 are the names of all tracks that are on playlists titled Movies? ### Input: CREATE TABLE genres (
id number,
name text
)
CREATE TABLE media_types (
id number,
name text
)
CREATE TABLE customers (
id number,
first_name text,
last_name text,
company text,
address text,
city text,
state text,
country text,
postal_code text,
phone text,
fax text,
email text,
support_rep_id number
)
CREATE TABLE employees (
id number,
last_name text,
first_name text,
title text,
reports_to number,
birth_date time,
hire_date time,
address text,
city text,
state text,
country text,
postal_code text,
phone text,
fax text,
email text
)
CREATE TABLE albums (
id number,
title text,
artist_id number
)
CREATE TABLE tracks (
id number,
name text,
album_id number,
media_type_id number,
genre_id number,
composer text,
milliseconds number,
bytes number,
unit_price number
)
CREATE TABLE invoices (
id number,
customer_id number,
invoice_date time,
billing_address text,
billing_city text,
billing_state text,
billing_country text,
billing_postal_code text,
total number
)
CREATE TABLE invoice_lines (
id number,
invoice_id number,
track_id number,
unit_price number,
quantity number
)
CREATE TABLE sqlite_sequence (
name text,
seq text
)
CREATE TABLE artists (
id number,
name text
)
CREATE TABLE playlists (
id number,
name text
)
CREATE TABLE playlist_tracks (
playlist_id number,
track_id number
) ### Response: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies"
|
How many Annual Meeting events happened in the United Kingdom region?
|
CREATE TABLE party (
region_id VARCHAR,
party_id VARCHAR
)
CREATE TABLE party_events (
party_id VARCHAR,
Event_Name VARCHAR
)
CREATE TABLE region (
region_id VARCHAR,
region_name VARCHAR
)
|
SELECT COUNT(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = "United Kingdom" AND t3.Event_Name = "Annaual Meeting"
|
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 Annual Meeting events happened in the United Kingdom region? ### Input: CREATE TABLE party (
region_id VARCHAR,
party_id VARCHAR
)
CREATE TABLE party_events (
party_id VARCHAR,
Event_Name VARCHAR
)
CREATE TABLE region (
region_id VARCHAR,
region_name VARCHAR
) ### Response: SELECT COUNT(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = "United Kingdom" AND t3.Event_Name = "Annaual Meeting"
|
When was the earliest year that kakha kaladze moved to milan with a rank above 9?
|
CREATE TABLE table_14327 (
"Rank" real,
"Year" real,
"Name" text,
"Moving from" text,
"Moving to" text
)
|
SELECT MIN("Year") FROM table_14327 WHERE "Moving to" = 'milan' AND "Name" = 'kakha kaladze' AND "Rank" < '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: When was the earliest year that kakha kaladze moved to milan with a rank above 9? ### Input: CREATE TABLE table_14327 (
"Rank" real,
"Year" real,
"Name" text,
"Moving from" text,
"Moving to" text
) ### Response: SELECT MIN("Year") FROM table_14327 WHERE "Moving to" = 'milan' AND "Name" = 'kakha kaladze' AND "Rank" < '9'
|
What is the average against of Murrayfield, Edinburgh?
|
CREATE TABLE table_59515 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
|
SELECT AVG("Against") FROM table_59515 WHERE "Venue" = 'murrayfield, edinburgh'
|
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 average against of Murrayfield, Edinburgh? ### Input: CREATE TABLE table_59515 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) ### Response: SELECT AVG("Against") FROM table_59515 WHERE "Venue" = 'murrayfield, edinburgh'
|
from WASHINGTON to PHILADELPHIA departing in the afternoon
|
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 TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE 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_required varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
|
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, state WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND state.state_code = 'DC' AND state.state_code = CITY_0.state_code) AND flight.departure_time BETWEEN 1200 AND 1800
|
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: from WASHINGTON to PHILADELPHIA departing in the afternoon ### Input: 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 TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE 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_required varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
) ### Response: 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, state WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND state.state_code = 'DC' AND state.state_code = CITY_0.state_code) AND flight.departure_time BETWEEN 1200 AND 1800
|
What is Date, when Record is '1-1'?
|
CREATE TABLE table_12221 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
|
SELECT "Date" FROM table_12221 WHERE "Record" = '1-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 Date, when Record is '1-1'? ### Input: CREATE TABLE table_12221 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) ### Response: SELECT "Date" FROM table_12221 WHERE "Record" = '1-1'
|
Name the gamecenter that has attendance of 65,212
|
CREATE TABLE table_name_17 (
gamecenter VARCHAR,
attendance VARCHAR
)
|
SELECT gamecenter FROM table_name_17 WHERE attendance = "65,212"
|
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 gamecenter that has attendance of 65,212 ### Input: CREATE TABLE table_name_17 (
gamecenter VARCHAR,
attendance VARCHAR
) ### Response: SELECT gamecenter FROM table_name_17 WHERE attendance = "65,212"
|
Bar chart x axis headquarters y axis the total number, and sort y-axis in asc order.
|
CREATE TABLE people (
People_ID int,
Age int,
Name text,
Nationality text,
Graduation_College text
)
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sales_in_Billion real,
Profits_in_Billion real,
Assets_in_Billion real,
Market_Value_in_Billion real
)
|
SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters 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: Bar chart x axis headquarters y axis the total number, and sort y-axis in asc order. ### Input: CREATE TABLE people (
People_ID int,
Age int,
Name text,
Nationality text,
Graduation_College text
)
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sales_in_Billion real,
Profits_in_Billion real,
Assets_in_Billion real,
Market_Value_in_Billion real
) ### Response: SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*)
|
how many games did they play total ?
|
CREATE TABLE table_204_180 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number
)
|
SELECT COUNT(*) FROM table_204_180
|
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 games did they play total ? ### Input: CREATE TABLE table_204_180 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number
) ### Response: SELECT COUNT(*) FROM table_204_180
|
What was the score at North Shore Events Centre?
|
CREATE TABLE table_name_9 (
score VARCHAR,
venue VARCHAR
)
|
SELECT score FROM table_name_9 WHERE venue = "north shore events centre"
|
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 at North Shore Events Centre? ### Input: CREATE TABLE table_name_9 (
score VARCHAR,
venue VARCHAR
) ### Response: SELECT score FROM table_name_9 WHERE venue = "north shore events centre"
|
what is primary disease and diagnoses icd9 code of subject name ida cook?
|
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
|
SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Ida Cook"
|
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 primary disease and diagnoses icd9 code of subject name ida cook? ### Input: 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Ida Cook"
|
Show the title and score of the movie with a pie chart.
|
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
)
|
SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID
|
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: Show the title and score of the movie with a pie chart. ### Input: CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
) ### Response: SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID
|
Name the number at march when class is j66
|
CREATE TABLE table_15608800_2 (
number_at_march VARCHAR,
class VARCHAR
)
|
SELECT number_at_march FROM table_15608800_2 WHERE class = "J66"
|
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 number at march when class is j66 ### Input: CREATE TABLE table_15608800_2 (
number_at_march VARCHAR,
class VARCHAR
) ### Response: SELECT number_at_march FROM table_15608800_2 WHERE class = "J66"
|
Name for me all PreMajor classes .
|
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
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_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
|
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
|
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: Name for me all PreMajor classes . ### Input: CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
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_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
|
In which season was there a competition in the Champions League?
|
CREATE TABLE table_52391 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"Score" text
)
|
SELECT "Season" FROM table_52391 WHERE "Competition" = 'champions league'
|
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: In which season was there a competition in the Champions League? ### Input: CREATE TABLE table_52391 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"Score" text
) ### Response: SELECT "Season" FROM table_52391 WHERE "Competition" = 'champions league'
|
What is the id of the reviewer whose name has substring Mike ?
|
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
)
|
SELECT rid FROM reviewer WHERE name LIKE "%Mike%"
|
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 the id of the reviewer whose name has substring Mike ? ### Input: CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
) ### Response: SELECT rid FROM reviewer WHERE name LIKE "%Mike%"
|
What is the nickname of the school located in Fairfax, VA?
|
CREATE TABLE table_name_98 (
nickname VARCHAR,
location VARCHAR
)
|
SELECT nickname FROM table_name_98 WHERE location = "fairfax, va"
|
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 nickname of the school located in Fairfax, VA? ### Input: CREATE TABLE table_name_98 (
nickname VARCHAR,
location VARCHAR
) ### Response: SELECT nickname FROM table_name_98 WHERE location = "fairfax, va"
|
Tell me the location for altitude being less thaan 6102
|
CREATE TABLE table_name_31 (
location VARCHAR,
altitude__metres_ INTEGER
)
|
SELECT location FROM table_name_31 WHERE altitude__metres_ < 6102
|
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 location for altitude being less thaan 6102 ### Input: CREATE TABLE table_name_31 (
location VARCHAR,
altitude__metres_ INTEGER
) ### Response: SELECT location FROM table_name_31 WHERE altitude__metres_ < 6102
|
what's the thursday iuppiter (jupiter) with friday venus (venus) being vendredi
|
CREATE TABLE table_17769 (
"Day: (see Irregularities )" text,
"Sunday S\u014dl (Sun)" text,
"Monday Luna (Moon)" text,
"Tuesday Mars (Mars)" text,
"Wednesday Mercurius (Mercury)" text,
"Thursday Iuppiter (Jupiter)" text,
"Friday Venus (Venus)" text,
"Saturday Saturnus ( Saturn)" text
)
|
SELECT "Thursday Iuppiter (Jupiter)" FROM table_17769 WHERE "Friday Venus (Venus)" = 'vendredi'
|
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 thursday iuppiter (jupiter) with friday venus (venus) being vendredi ### Input: CREATE TABLE table_17769 (
"Day: (see Irregularities )" text,
"Sunday S\u014dl (Sun)" text,
"Monday Luna (Moon)" text,
"Tuesday Mars (Mars)" text,
"Wednesday Mercurius (Mercury)" text,
"Thursday Iuppiter (Jupiter)" text,
"Friday Venus (Venus)" text,
"Saturday Saturnus ( Saturn)" text
) ### Response: SELECT "Thursday Iuppiter (Jupiter)" FROM table_17769 WHERE "Friday Venus (Venus)" = 'vendredi'
|
Name the number in series for production code being 204
|
CREATE TABLE table_25810656_3 (
no_in_series VARCHAR,
production_code VARCHAR
)
|
SELECT no_in_series FROM table_25810656_3 WHERE production_code = 204
|
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 number in series for production code being 204 ### Input: CREATE TABLE table_25810656_3 (
no_in_series VARCHAR,
production_code VARCHAR
) ### Response: SELECT no_in_series FROM table_25810656_3 WHERE production_code = 204
|
Who was the runner-up in the Michelob Light Open at Kingsmill?
|
CREATE TABLE table_11054 (
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text
)
|
SELECT "Runner(s)-up" FROM table_11054 WHERE "Tournament" = 'michelob light open at kingsmill'
|
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 was the runner-up in the Michelob Light Open at Kingsmill? ### Input: CREATE TABLE table_11054 (
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text
) ### Response: SELECT "Runner(s)-up" FROM table_11054 WHERE "Tournament" = 'michelob light open at kingsmill'
|
which primary disease is the patient stephanie suchan suffering from?
|
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
|
SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Stephanie Suchan"
|
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: which primary disease is the patient stephanie suchan suffering from? ### Input: 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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Stephanie Suchan"
|
What is the nomination title used for the original film, Zwartboek?
|
CREATE TABLE table_6986 (
"Year" text,
"Film title used in nomination" text,
"Original title" text,
"Main Language(s)" text,
"Result" text
)
|
SELECT "Film title used in nomination" FROM table_6986 WHERE "Original title" = 'zwartboek'
|
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 nomination title used for the original film, Zwartboek? ### Input: CREATE TABLE table_6986 (
"Year" text,
"Film title used in nomination" text,
"Original title" text,
"Main Language(s)" text,
"Result" text
) ### Response: SELECT "Film title used in nomination" FROM table_6986 WHERE "Original title" = 'zwartboek'
|
Which overall pick number went to college at Youngstown State?
|
CREATE TABLE table_16061 (
"Round" real,
"Choice" real,
"Overall" real,
"Player name" text,
"Position" text,
"College" text
)
|
SELECT MIN("Overall") FROM table_16061 WHERE "College" = 'Youngstown State'
|
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 overall pick number went to college at Youngstown State? ### Input: CREATE TABLE table_16061 (
"Round" real,
"Choice" real,
"Overall" real,
"Player name" text,
"Position" text,
"College" text
) ### Response: SELECT MIN("Overall") FROM table_16061 WHERE "College" = 'Youngstown State'
|
Name the number of draws for when conceded is 25
|
CREATE TABLE table_19648 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
)
|
SELECT COUNT("Draws") FROM table_19648 WHERE "Conceded" = '25'
|
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 number of draws for when conceded is 25 ### Input: CREATE TABLE table_19648 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) ### Response: SELECT COUNT("Draws") FROM table_19648 WHERE "Conceded" = '25'
|
what is the score when the surface is hard and outcome is runner-up?
|
CREATE TABLE table_name_85 (
score VARCHAR,
surface VARCHAR,
outcome VARCHAR
)
|
SELECT score FROM table_name_85 WHERE surface = "hard" AND outcome = "runner-up"
|
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 when the surface is hard and outcome is runner-up? ### Input: CREATE TABLE table_name_85 (
score VARCHAR,
surface VARCHAR,
outcome VARCHAR
) ### Response: SELECT score FROM table_name_85 WHERE surface = "hard" AND outcome = "runner-up"
|
What is the highest localities?
|
CREATE TABLE table_28243 (
"Metropolitan ring" text,
"Localities" real,
"Total" real,
"Jews and others 1" real,
"Thereof: Jews" real,
"Arabs" real,
"Population density (per km\u00b2)" text,
"Annual Population growth rate" text
)
|
SELECT MAX("Localities") FROM table_28243
|
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 localities? ### Input: CREATE TABLE table_28243 (
"Metropolitan ring" text,
"Localities" real,
"Total" real,
"Jews and others 1" real,
"Thereof: Jews" real,
"Arabs" real,
"Population density (per km\u00b2)" text,
"Annual Population growth rate" text
) ### Response: SELECT MAX("Localities") FROM table_28243
|
which county is the only one to have an area less than 1,000 square kilometers ?
|
CREATE TABLE table_204_778 (
id number,
"code" number,
"county" text,
"former province" text,
"area (km2)" number,
"population\ncensus 2009" number,
"capital" text
)
|
SELECT "county" FROM table_204_778 WHERE "area (km2)" < 1000
|
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: which county is the only one to have an area less than 1,000 square kilometers ? ### Input: CREATE TABLE table_204_778 (
id number,
"code" number,
"county" text,
"former province" text,
"area (km2)" number,
"population\ncensus 2009" number,
"capital" text
) ### Response: SELECT "county" FROM table_204_778 WHERE "area (km2)" < 1000
|
What week of the season had a date of october 5, 1975?
|
CREATE TABLE table_name_24 (
week INTEGER,
date VARCHAR
)
|
SELECT MIN(week) FROM table_name_24 WHERE date = "october 5, 1975"
|
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 week of the season had a date of october 5, 1975? ### Input: CREATE TABLE table_name_24 (
week INTEGER,
date VARCHAR
) ### Response: SELECT MIN(week) FROM table_name_24 WHERE date = "october 5, 1975"
|
Which team is located in Westland and was previously in the Western Lakes Activities Association?
|
CREATE TABLE table_52250 (
"Team" text,
"Location" text,
"Joined" real,
"Conference" text,
"Division" text,
"Previous Conference" text
)
|
SELECT "Team" FROM table_52250 WHERE "Previous Conference" = 'western lakes activities association' AND "Location" = 'westland'
|
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 team is located in Westland and was previously in the Western Lakes Activities Association? ### Input: CREATE TABLE table_52250 (
"Team" text,
"Location" text,
"Joined" real,
"Conference" text,
"Division" text,
"Previous Conference" text
) ### Response: SELECT "Team" FROM table_52250 WHERE "Previous Conference" = 'western lakes activities association' AND "Location" = 'westland'
|
When was the last win of Celtic?
|
CREATE TABLE table_34526 (
"Club" text,
"Wins" text,
"Last win" text,
"Runners-up" text,
"Last final lost" text
)
|
SELECT "Last win" FROM table_34526 WHERE "Club" = 'celtic'
|
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: When was the last win of Celtic? ### Input: CREATE TABLE table_34526 (
"Club" text,
"Wins" text,
"Last win" text,
"Runners-up" text,
"Last final lost" text
) ### Response: SELECT "Last win" FROM table_34526 WHERE "Club" = 'celtic'
|
How many losses have points against greater than 592, with high park demons as the club, and points for greater than 631?
|
CREATE TABLE table_40058 (
"Club" text,
"Wins" real,
"Loses" real,
"Points For" real,
"Points Against" real,
"Percentage" text,
"Points" real
)
|
SELECT COUNT("Loses") FROM table_40058 WHERE "Points Against" > '592' AND "Club" = 'high park demons' AND "Points For" > '631'
|
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 losses have points against greater than 592, with high park demons as the club, and points for greater than 631? ### Input: CREATE TABLE table_40058 (
"Club" text,
"Wins" real,
"Loses" real,
"Points For" real,
"Points Against" real,
"Percentage" text,
"Points" real
) ### Response: SELECT COUNT("Loses") FROM table_40058 WHERE "Points Against" > '592' AND "Club" = 'high park demons' AND "Points For" > '631'
|
A bar chart for finding the number of the parties associated with the delegates from district 1 or 2 Who served as comptrollers of the parties?, I want to list by the total number from high to low.
|
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
|
SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY COUNT(Comptroller) 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: A bar chart for finding the number of the parties associated with the delegates from district 1 or 2 Who served as comptrollers of the parties?, I want to list by the total number from high to low. ### Input: CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
) ### Response: SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY COUNT(Comptroller) DESC
|
Name the country moving to chelsea
|
CREATE TABLE table_51863 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
)
|
SELECT "Country" FROM table_51863 WHERE "Moving to" = 'chelsea'
|
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 country moving to chelsea ### Input: CREATE TABLE table_51863 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
) ### Response: SELECT "Country" FROM table_51863 WHERE "Moving to" = 'chelsea'
|
What are the highest points for Justin Lofton when his top 10 is lower than 5?
|
CREATE TABLE table_name_14 (
points INTEGER,
driver VARCHAR,
top_10 VARCHAR
)
|
SELECT MAX(points) FROM table_name_14 WHERE driver = "justin lofton" AND top_10 < 5
|
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 the highest points for Justin Lofton when his top 10 is lower than 5? ### Input: CREATE TABLE table_name_14 (
points INTEGER,
driver VARCHAR,
top_10 VARCHAR
) ### Response: SELECT MAX(points) FROM table_name_14 WHERE driver = "justin lofton" AND top_10 < 5
|
Show me about the distribution of family_name and author_id in a bar chart.
|
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
|
SELECT family_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
|
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: Show me about the distribution of family_name and author_id in a bar chart. ### Input: CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
) ### Response: SELECT family_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
|
did atlantic coast conference have more or less bids than colonial athletic association ?
|
CREATE TABLE table_203_187 (
id number,
"conference" text,
"bids" number,
"record" text,
"win %" number,
"quarterfinals" number,
"semifinals" number,
"final" number,
"champions" number
)
|
SELECT (SELECT "bids" FROM table_203_187 WHERE "conference" = 'atlantic coast conference') > (SELECT "bids" FROM table_203_187 WHERE "conference" = 'colonial athletic association')
|
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: did atlantic coast conference have more or less bids than colonial athletic association ? ### Input: CREATE TABLE table_203_187 (
id number,
"conference" text,
"bids" number,
"record" text,
"win %" number,
"quarterfinals" number,
"semifinals" number,
"final" number,
"champions" number
) ### Response: SELECT (SELECT "bids" FROM table_203_187 WHERE "conference" = 'atlantic coast conference') > (SELECT "bids" FROM table_203_187 WHERE "conference" = 'colonial athletic association')
|
Bar graph to show the average of product price from different product category code
|
CREATE TABLE Complaints (
complaint_id INTEGER,
product_id INTEGER,
customer_id INTEGER,
complaint_outcome_code VARCHAR(20),
complaint_status_code VARCHAR(20),
complaint_type_code VARCHAR(20),
date_complaint_raised DATETIME,
date_complaint_closed DATETIME,
staff_id INTEGER
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
product_category_code VARCHAR(20),
date_product_first_available DATETIME,
date_product_discontinued DATETIME,
product_name VARCHAR(80),
product_description VARCHAR(255),
product_price DECIMAL(19,4)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_type_code VARCHAR(20),
address_line_1 VARCHAR(80),
address_line_2 VARCHAR(80),
town_city VARCHAR(80),
state VARCHAR(80),
email_address VARCHAR(255),
phone_number VARCHAR(80)
)
CREATE TABLE Staff (
staff_id INTEGER,
gender VARCHAR(1),
first_name VARCHAR(80),
last_name VARCHAR(80),
email_address VARCHAR(255),
phone_number VARCHAR(80)
)
|
SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_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: Bar graph to show the average of product price from different product category code ### Input: CREATE TABLE Complaints (
complaint_id INTEGER,
product_id INTEGER,
customer_id INTEGER,
complaint_outcome_code VARCHAR(20),
complaint_status_code VARCHAR(20),
complaint_type_code VARCHAR(20),
date_complaint_raised DATETIME,
date_complaint_closed DATETIME,
staff_id INTEGER
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
product_category_code VARCHAR(20),
date_product_first_available DATETIME,
date_product_discontinued DATETIME,
product_name VARCHAR(80),
product_description VARCHAR(255),
product_price DECIMAL(19,4)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_type_code VARCHAR(20),
address_line_1 VARCHAR(80),
address_line_2 VARCHAR(80),
town_city VARCHAR(80),
state VARCHAR(80),
email_address VARCHAR(255),
phone_number VARCHAR(80)
)
CREATE TABLE Staff (
staff_id INTEGER,
gender VARCHAR(1),
first_name VARCHAR(80),
last_name VARCHAR(80),
email_address VARCHAR(255),
phone_number VARCHAR(80)
) ### Response: SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code
|
What is the lowest against of the wimmera fl warrack eagles, which have less than 16 wins?
|
CREATE TABLE table_name_33 (
against INTEGER,
wins VARCHAR,
wimmera_fl VARCHAR
)
|
SELECT MIN(against) FROM table_name_33 WHERE wins < 16 AND wimmera_fl = "warrack eagles"
|
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 lowest against of the wimmera fl warrack eagles, which have less than 16 wins? ### Input: CREATE TABLE table_name_33 (
against INTEGER,
wins VARCHAR,
wimmera_fl VARCHAR
) ### Response: SELECT MIN(against) FROM table_name_33 WHERE wins < 16 AND wimmera_fl = "warrack eagles"
|
count the number of male patients who were admitted in hospital before 2127.
|
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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 (
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
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admityear < "2127"
|
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: count the number of male patients who were admitted in hospital before 2127. ### Input: 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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 (
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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admityear < "2127"
|
How many accounts for different account details? Draw a bar chart, sort X-axis in asc order please.
|
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
derived_product_cost DECIMAL(19,4),
derived_vat_payable DECIMAL(19,4),
derived_total_cost DECIMAL(19,4)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(50),
customer_middle_initial VARCHAR(1),
customer_last_name VARCHAR(50),
gender VARCHAR(1),
email_address VARCHAR(255),
login_name VARCHAR(80),
login_password VARCHAR(20),
phone_number VARCHAR(255),
town_city VARCHAR(50),
state_county_province VARCHAR(50),
country VARCHAR(50)
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
product_color VARCHAR(20),
product_size VARCHAR(20)
)
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
|
SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details ORDER BY other_account_details
|
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: How many accounts for different account details? Draw a bar chart, sort X-axis in asc order please. ### Input: CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
derived_product_cost DECIMAL(19,4),
derived_vat_payable DECIMAL(19,4),
derived_total_cost DECIMAL(19,4)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(50),
customer_middle_initial VARCHAR(1),
customer_last_name VARCHAR(50),
gender VARCHAR(1),
email_address VARCHAR(255),
login_name VARCHAR(80),
login_password VARCHAR(20),
phone_number VARCHAR(255),
town_city VARCHAR(50),
state_county_province VARCHAR(50),
country VARCHAR(50)
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
product_color VARCHAR(20),
product_size VARCHAR(20)
)
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
) ### Response: SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details ORDER BY other_account_details
|
What was the score of the match in which Portsmouth was the Away team?
|
CREATE TABLE table_10274 (
"Tie no" text,
"Home team" text,
"Score 1" text,
"Away team" text,
"Attendance" text
)
|
SELECT "Score 1" FROM table_10274 WHERE "Away team" = 'portsmouth'
|
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 score of the match in which Portsmouth was the Away team? ### Input: CREATE TABLE table_10274 (
"Tie no" text,
"Home team" text,
"Score 1" text,
"Away team" text,
"Attendance" text
) ### Response: SELECT "Score 1" FROM table_10274 WHERE "Away team" = 'portsmouth'
|
has patient 005-4471 excreted output (ml)-chest tube #2 midaxillary left mid;lateral today?
|
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 (
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 time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
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,
chargetime time,
cost number
)
|
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'output (ml)-chest tube #2 midaxillary left mid;lateral' AND DATETIME(intakeoutput.intakeoutputtime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day')
|
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: has patient 005-4471 excreted output (ml)-chest tube #2 midaxillary left mid;lateral today? ### Input: CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 (
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 time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
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,
chargetime time,
cost number
) ### Response: SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'output (ml)-chest tube #2 midaxillary left mid;lateral' AND DATETIME(intakeoutput.intakeoutputtime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day')
|
what was the name of the organism detected in patient 5849's last microbiological urine test since 05/2103?
|
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
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,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
|
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5849) AND microbiologyevents.spec_type_desc = 'urine' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime) >= '2103-05' ORDER BY microbiologyevents.charttime DESC LIMIT 1
|
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 was the name of the organism detected in patient 5849's last microbiological urine test since 05/2103? ### Input: CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
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,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
) ### Response: SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5849) AND microbiologyevents.spec_type_desc = 'urine' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime) >= '2103-05' ORDER BY microbiologyevents.charttime DESC LIMIT 1
|
When the type is 'reset' what is the description?
|
CREATE TABLE table_19854 (
"Category" text,
"Type" text,
"Attribute" text,
"Description" text,
"Bubbles" text,
"Cancelable" text
)
|
SELECT "Description" FROM table_19854 WHERE "Type" = 'reset'
|
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: When the type is 'reset' what is the description? ### Input: CREATE TABLE table_19854 (
"Category" text,
"Type" text,
"Attribute" text,
"Description" text,
"Bubbles" text,
"Cancelable" text
) ### Response: SELECT "Description" FROM table_19854 WHERE "Type" = 'reset'
|
calculate the total amount of input of patient 006-65715 on 01/23/last year.
|
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 TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
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 time
)
|
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-65715')) AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m-%d', intakeoutput.intakeoutputtime) = '01-23'
|
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: calculate the total amount of input of patient 006-65715 on 01/23/last year. ### Input: 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 TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
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 time
) ### Response: SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-65715')) AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m-%d', intakeoutput.intakeoutputtime) = '01-23'
|
Name the crew chief for ricky craven
|
CREATE TABLE table_24667 (
"Team" text,
"Truck(s)" text,
"#" real,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Listed Owner(s)" text,
"Crew Chief" text
)
|
SELECT "Crew Chief" FROM table_24667 WHERE "Driver(s)" = 'Ricky Craven'
|
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 crew chief for ricky craven ### Input: CREATE TABLE table_24667 (
"Team" text,
"Truck(s)" text,
"#" real,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Listed Owner(s)" text,
"Crew Chief" text
) ### Response: SELECT "Crew Chief" FROM table_24667 WHERE "Driver(s)" = 'Ricky Craven'
|
Who was the winner on a hard surface on the week of November 13?
|
CREATE TABLE table_name_30 (
winner VARCHAR,
surface VARCHAR,
week VARCHAR
)
|
SELECT winner FROM table_name_30 WHERE surface = "hard" AND week = "november 13"
|
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 was the winner on a hard surface on the week of November 13? ### Input: CREATE TABLE table_name_30 (
winner VARCHAR,
surface VARCHAR,
week VARCHAR
) ### Response: SELECT winner FROM table_name_30 WHERE surface = "hard" AND week = "november 13"
|
Where did they play the San Diego Chargers?
|
CREATE TABLE table_13259009_2 (
game_site VARCHAR,
opponent VARCHAR
)
|
SELECT game_site FROM table_13259009_2 WHERE opponent = "San Diego Chargers"
|
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: Where did they play the San Diego Chargers? ### Input: CREATE TABLE table_13259009_2 (
game_site VARCHAR,
opponent VARCHAR
) ### Response: SELECT game_site FROM table_13259009_2 WHERE opponent = "San Diego Chargers"
|
Questions (id, title) of a given user.
|
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
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 Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
|
SELECT Id AS "post_link", Title, CreationDate, Score FROM Posts WHERE OwnerUserId = '##user?36688##' AND PostTypeId = 1 ORDER BY CreationDate DESC
|
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: Questions (id, title) of a given user. ### Input: CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
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 Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
) ### Response: SELECT Id AS "post_link", Title, CreationDate, Score FROM Posts WHERE OwnerUserId = '##user?36688##' AND PostTypeId = 1 ORDER BY CreationDate DESC
|
Who are the mens singles and womens singles with sun yu?
|
CREATE TABLE table_18804 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
)
|
SELECT "Mens singles" FROM table_18804 WHERE "Womens singles" = 'Sun Yu'
|
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 are the mens singles and womens singles with sun yu? ### Input: CREATE TABLE table_18804 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) ### Response: SELECT "Mens singles" FROM table_18804 WHERE "Womens singles" = 'Sun Yu'
|
count the number of patients whose marital status is married and procedure icd9 code is 4611?
|
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.icd9_code = "4611"
|
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: count the number of patients whose marital status is married and procedure icd9 code is 4611? ### Input: 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.icd9_code = "4611"
|
How many years had a formula of Grand Prix?
|
CREATE TABLE table_name_46 (
year VARCHAR,
formula VARCHAR
)
|
SELECT COUNT(year) FROM table_name_46 WHERE formula = "grand prix"
|
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 years had a formula of Grand Prix? ### Input: CREATE TABLE table_name_46 (
year VARCHAR,
formula VARCHAR
) ### Response: SELECT COUNT(year) FROM table_name_46 WHERE formula = "grand prix"
|
How many teams are listed for February 18?
|
CREATE TABLE table_20353 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
|
SELECT COUNT("Team") FROM table_20353 WHERE "Date" = 'February 18'
|
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 teams are listed for February 18? ### Input: CREATE TABLE table_20353 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) ### Response: SELECT COUNT("Team") FROM table_20353 WHERE "Date" = 'February 18'
|
What is the average Bronze, when Silver is 0, when Rank is 19, and when Total is greater than 2?
|
CREATE TABLE table_name_29 (
bronze INTEGER,
total VARCHAR,
silver VARCHAR,
rank VARCHAR
)
|
SELECT AVG(bronze) FROM table_name_29 WHERE silver = 0 AND rank = "19" AND total > 2
|
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 average Bronze, when Silver is 0, when Rank is 19, and when Total is greater than 2? ### Input: CREATE TABLE table_name_29 (
bronze INTEGER,
total VARCHAR,
silver VARCHAR,
rank VARCHAR
) ### Response: SELECT AVG(bronze) FROM table_name_29 WHERE silver = 0 AND rank = "19" AND total > 2
|
Where is California Lutheran University located?
|
CREATE TABLE table_14976504_2 (
location VARCHAR,
institution VARCHAR
)
|
SELECT COUNT(location) FROM table_14976504_2 WHERE institution = "California Lutheran University"
|
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: Where is California Lutheran University located? ### Input: CREATE TABLE table_14976504_2 (
location VARCHAR,
institution VARCHAR
) ### Response: SELECT COUNT(location) FROM table_14976504_2 WHERE institution = "California Lutheran University"
|
What is the French word for the Italian word nazione?
|
CREATE TABLE table_19819 (
"Ido" text,
"English" text,
"Italian" text,
"French" text,
"German" text,
"Russian" text,
"Spanish" text
)
|
SELECT "French" FROM table_19819 WHERE "Italian" = 'nazione'
|
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 French word for the Italian word nazione? ### Input: CREATE TABLE table_19819 (
"Ido" text,
"English" text,
"Italian" text,
"French" text,
"German" text,
"Russian" text,
"Spanish" text
) ### Response: SELECT "French" FROM table_19819 WHERE "Italian" = 'nazione'
|
what name is above may 1944
|
CREATE TABLE table_204_577 (
id number,
"name" text,
"first operational" text,
"numeral system" text,
"computing mechanism" text,
"programming" text,
"turing complete" text
)
|
SELECT "name" FROM table_204_577 WHERE "first operational" < (SELECT "first operational" FROM table_204_577 WHERE "first operational" = 'may 1944') ORDER BY "first operational" 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: what name is above may 1944 ### Input: CREATE TABLE table_204_577 (
id number,
"name" text,
"first operational" text,
"numeral system" text,
"computing mechanism" text,
"programming" text,
"turing complete" text
) ### Response: SELECT "name" FROM table_204_577 WHERE "first operational" < (SELECT "first operational" FROM table_204_577 WHERE "first operational" = 'may 1944') ORDER BY "first operational" DESC LIMIT 1
|
is dem boyz or felonies have the featured guest p. diddy ?
|
CREATE TABLE table_204_184 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"featured guest(s)" text,
"length" text
)
|
SELECT "title" FROM table_204_184 WHERE "title" IN ('"dem boyz"', '"felonies"') AND "featured guest(s)" = 'p. diddy'
|
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: is dem boyz or felonies have the featured guest p. diddy ? ### Input: CREATE TABLE table_204_184 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"featured guest(s)" text,
"length" text
) ### Response: SELECT "title" FROM table_204_184 WHERE "title" IN ('"dem boyz"', '"felonies"') AND "featured guest(s)" = 'p. diddy'
|
How many entrants did the events won by Frank Gary average?
|
CREATE TABLE table_38768 (
"Entrants" real,
"Winner" text,
"Prize" text,
"Runner-up" text,
"Results" text
)
|
SELECT AVG("Entrants") FROM table_38768 WHERE "Winner" = 'frank gary'
|
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 entrants did the events won by Frank Gary average? ### Input: CREATE TABLE table_38768 (
"Entrants" real,
"Winner" text,
"Prize" text,
"Runner-up" text,
"Results" text
) ### Response: SELECT AVG("Entrants") FROM table_38768 WHERE "Winner" = 'frank gary'
|
which game has the least attendance ?
|
CREATE TABLE table_204_513 (
id number,
"date" text,
"time" text,
"opponent#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
)
|
SELECT "opponent#" FROM table_204_513 ORDER BY "attendance" 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: which game has the least attendance ? ### Input: CREATE TABLE table_204_513 (
id number,
"date" text,
"time" text,
"opponent#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) ### Response: SELECT "opponent#" FROM table_204_513 ORDER BY "attendance" LIMIT 1
|
Which Saturday has a Thursday of mokuy bi
|
CREATE TABLE table_name_8 (
saturday VARCHAR,
thursday VARCHAR
)
|
SELECT saturday FROM table_name_8 WHERE thursday = "木曜日 mokuyōbi"
|
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: Which Saturday has a Thursday of mokuy bi ### Input: CREATE TABLE table_name_8 (
saturday VARCHAR,
thursday VARCHAR
) ### Response: SELECT saturday FROM table_name_8 WHERE thursday = "木曜日 mokuyōbi"
|
For those dates that have the 5 highest cloud cover rates, please bin the date into the day of week interval and count their frequency.
|
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pressure_inches NUMERIC,
mean_sea_level_pressure_inches NUMERIC,
min_sea_level_pressure_inches NUMERIC,
max_visibility_miles INTEGER,
mean_visibility_miles INTEGER,
min_visibility_miles INTEGER,
max_wind_Speed_mph INTEGER,
mean_wind_speed_mph INTEGER,
max_gust_speed_mph INTEGER,
precipitation_inches INTEGER,
cloud_cover INTEGER,
events TEXT,
wind_dir_degrees INTEGER,
zip_code INTEGER
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
|
SELECT date, COUNT(date) FROM weather
|
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 dates that have the 5 highest cloud cover rates, please bin the date into the day of week interval and count their frequency. ### Input: CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pressure_inches NUMERIC,
mean_sea_level_pressure_inches NUMERIC,
min_sea_level_pressure_inches NUMERIC,
max_visibility_miles INTEGER,
mean_visibility_miles INTEGER,
min_visibility_miles INTEGER,
max_wind_Speed_mph INTEGER,
mean_wind_speed_mph INTEGER,
max_gust_speed_mph INTEGER,
precipitation_inches INTEGER,
cloud_cover INTEGER,
events TEXT,
wind_dir_degrees INTEGER,
zip_code INTEGER
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
) ### Response: SELECT date, COUNT(date) FROM weather
|
On what date was the opponent the Miami Dolphins?
|
CREATE TABLE table_8744 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
|
SELECT "Date" FROM table_8744 WHERE "Opponent" = 'miami dolphins'
|
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: On what date was the opponent the Miami Dolphins? ### Input: CREATE TABLE table_8744 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) ### Response: SELECT "Date" FROM table_8744 WHERE "Opponent" = 'miami dolphins'
|
What is the average reaction for brigitte foster-hylton after heat 1?
|
CREATE TABLE table_name_53 (
reaction INTEGER,
heat VARCHAR,
name VARCHAR
)
|
SELECT AVG(reaction) FROM table_name_53 WHERE heat > 1 AND name = "brigitte foster-hylton"
|
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 average reaction for brigitte foster-hylton after heat 1? ### Input: CREATE TABLE table_name_53 (
reaction INTEGER,
heat VARCHAR,
name VARCHAR
) ### Response: SELECT AVG(reaction) FROM table_name_53 WHERE heat > 1 AND name = "brigitte foster-hylton"
|
count the number of patients whose diagnoses icd9 code is 6826?
|
CREATE TABLE procedures (
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 (
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.icd9_code = "6826"
|
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: count the number of patients whose diagnoses icd9 code is 6826? ### Input: CREATE TABLE procedures (
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "6826"
|
what is the name of the race where newman/haas racing is the winning team and rick mears is at the pole position?
|
CREATE TABLE table_16258 (
"Rnd" text,
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
|
SELECT "Race Name" FROM table_16258 WHERE "Winning team" = 'Newman/Haas Racing' AND "Pole position" = 'Rick Mears'
|
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 name of the race where newman/haas racing is the winning team and rick mears is at the pole position? ### Input: CREATE TABLE table_16258 (
"Rnd" text,
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) ### Response: SELECT "Race Name" FROM table_16258 WHERE "Winning team" = 'Newman/Haas Racing' AND "Pole position" = 'Rick Mears'
|
what is the rank of adam gilchrist
|
CREATE TABLE table_23382 (
"Rank" real,
"Dismissals" real,
"Player" text,
"Caught" real,
"Stumped" real,
"Matches" real,
"Innings" real
)
|
SELECT COUNT("Rank") FROM table_23382 WHERE "Player" = 'Adam Gilchrist'
|
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 rank of adam gilchrist ### Input: CREATE TABLE table_23382 (
"Rank" real,
"Dismissals" real,
"Player" text,
"Caught" real,
"Stumped" real,
"Matches" real,
"Innings" real
) ### Response: SELECT COUNT("Rank") FROM table_23382 WHERE "Player" = 'Adam Gilchrist'
|
when did patient 20862 get a d5w intake for the last time on 02/19/last year?
|
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
|
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20862)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5w' AND d_items.linksto = 'inputevents_cv') AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m-%d', inputevents_cv.charttime) = '02-19' ORDER BY inputevents_cv.charttime DESC LIMIT 1
|
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: when did patient 20862 get a d5w intake for the last time on 02/19/last year? ### Input: CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
) ### Response: SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20862)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5w' AND d_items.linksto = 'inputevents_cv') AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m-%d', inputevents_cv.charttime) = '02-19' ORDER BY inputevents_cv.charttime DESC LIMIT 1
|
Name the Player which has a To par of 6?
|
CREATE TABLE table_60260 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
|
SELECT "Player" FROM table_60260 WHERE "To par" = '–6'
|
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 Player which has a To par of 6? ### Input: CREATE TABLE table_60260 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) ### Response: SELECT "Player" FROM table_60260 WHERE "To par" = '–6'
|
How many games were played by the player with 927 points?
|
CREATE TABLE table_2551 (
"Season" text,
"Player" text,
"Nationality" text,
"Team" text,
"Points" real,
"Average" text,
"Played" real
)
|
SELECT "Played" FROM table_2551 WHERE "Points" = '927'
|
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 games were played by the player with 927 points? ### Input: CREATE TABLE table_2551 (
"Season" text,
"Player" text,
"Nationality" text,
"Team" text,
"Points" real,
"Average" text,
"Played" real
) ### Response: SELECT "Played" FROM table_2551 WHERE "Points" = '927'
|
How many people were in attendance at Glenferrie Oval?
|
CREATE TABLE table_name_43 (
crowd INTEGER,
venue VARCHAR
)
|
SELECT MIN(crowd) FROM table_name_43 WHERE venue = "glenferrie oval"
|
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 people were in attendance at Glenferrie Oval? ### Input: CREATE TABLE table_name_43 (
crowd INTEGER,
venue VARCHAR
) ### Response: SELECT MIN(crowd) FROM table_name_43 WHERE venue = "glenferrie oval"
|
What is the Voges-Proskauer reading for proteus mirabilis?
|
CREATE TABLE table_39978 (
"Species" text,
"Indole" text,
"Methyl Red" text,
"Voges-Proskauer" text,
"Citrate" text
)
|
SELECT "Voges-Proskauer" FROM table_39978 WHERE "Species" = 'proteus mirabilis'
|
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 Voges-Proskauer reading for proteus mirabilis? ### Input: CREATE TABLE table_39978 (
"Species" text,
"Indole" text,
"Methyl Red" text,
"Voges-Proskauer" text,
"Citrate" text
) ### Response: SELECT "Voges-Proskauer" FROM table_39978 WHERE "Species" = 'proteus mirabilis'
|
what are patient 12775's genders?
|
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE 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 TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
|
SELECT patients.gender FROM patients WHERE patients.subject_id = 12775
|
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 patient 12775's genders? ### Input: CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE 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 TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
) ### Response: SELECT patients.gender FROM patients WHERE patients.subject_id = 12775
|
are there more players from sweden or canada ?
|
CREATE TABLE table_204_140 (
id number,
"round" number,
"#" number,
"player" text,
"position" text,
"nationality" text,
"college/junior/club team (league)" text
)
|
SELECT "nationality" FROM table_204_140 WHERE "nationality" IN ('sweden', 'canada') GROUP BY "nationality" ORDER BY COUNT("player") 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: are there more players from sweden or canada ? ### Input: CREATE TABLE table_204_140 (
id number,
"round" number,
"#" number,
"player" text,
"position" text,
"nationality" text,
"college/junior/club team (league)" text
) ### Response: SELECT "nationality" FROM table_204_140 WHERE "nationality" IN ('sweden', 'canada') GROUP BY "nationality" ORDER BY COUNT("player") DESC LIMIT 1
|
what is the name of the drug which has been prescribed to patient 030-34260 two times since 12/2105?
|
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 vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
|
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260')) AND STRFTIME('%y-%m', medication.drugstarttime) >= '2105-12' GROUP BY medication.drugname) AS t1 WHERE t1.c1 = 2
|
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 is the name of the drug which has been prescribed to patient 030-34260 two times since 12/2105? ### Input: 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 vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
) ### Response: SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260')) AND STRFTIME('%y-%m', medication.drugstarttime) >= '2105-12' GROUP BY medication.drugname) AS t1 WHERE t1.c1 = 2
|
How many seats did the election before 2004 with 3.4% share of votes have?
|
CREATE TABLE table_name_72 (
seats VARCHAR,
election VARCHAR,
share_of_votes VARCHAR
)
|
SELECT seats FROM table_name_72 WHERE election < 2004 AND share_of_votes = "3.4%"
|
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 seats did the election before 2004 with 3.4% share of votes have? ### Input: CREATE TABLE table_name_72 (
seats VARCHAR,
election VARCHAR,
share_of_votes VARCHAR
) ### Response: SELECT seats FROM table_name_72 WHERE election < 2004 AND share_of_votes = "3.4%"
|
What is the total of wins when the evens is less than 3?
|
CREATE TABLE table_42616 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
|
SELECT SUM("Wins") FROM table_42616 WHERE "Events" < '3'
|
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 of wins when the evens is less than 3? ### Input: CREATE TABLE table_42616 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) ### Response: SELECT SUM("Wins") FROM table_42616 WHERE "Events" < '3'
|
What is the average bronze medals of Uganda's swimmers when they earned over 2 medals?
|
CREATE TABLE table_68248 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
|
SELECT AVG("Bronze") FROM table_68248 WHERE "Nation" = 'uganda' AND "Total" > '2'
|
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 average bronze medals of Uganda's swimmers when they earned over 2 medals? ### Input: CREATE TABLE table_68248 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) ### Response: SELECT AVG("Bronze") FROM table_68248 WHERE "Nation" = 'uganda' AND "Total" > '2'
|
What was the 1st leg score for the team with an Agg score of 151-134?
|
CREATE TABLE table_name_36 (
agg VARCHAR
)
|
SELECT 1 AS st_leg FROM table_name_36 WHERE agg = "151-134"
|
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 1st leg score for the team with an Agg score of 151-134? ### Input: CREATE TABLE table_name_36 (
agg VARCHAR
) ### Response: SELECT 1 AS st_leg FROM table_name_36 WHERE agg = "151-134"
|
What is the title of the film when the producer was 2003?
|
CREATE TABLE table_name_65 (
title VARCHAR,
producer VARCHAR
)
|
SELECT title FROM table_name_65 WHERE producer = "2003"
|
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 film when the producer was 2003? ### Input: CREATE TABLE table_name_65 (
title VARCHAR,
producer VARCHAR
) ### Response: SELECT title FROM table_name_65 WHERE producer = "2003"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.