instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### Instruction: 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, adm...
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Dona Cole"
### Instruction: 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, lon...
SELECT demographic.insurance FROM demographic WHERE demographic.name = "Kelly Gallardo"
### Instruction: CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE instructor ( id text, name text, ...
SELECT DISTINCT building FROM classroom WHERE capacity > 50
### Instruction: CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE,...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) ORDER BY COUNT(Date_Claim_Made)
### Instruction: 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, adm...
SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Michael Witt"
### Instruction: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, ...
SELECT demographic.language FROM demographic WHERE demographic.name = "Stephanie Suchan"
### Instruction: 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, lo...
SELECT demographic.gender FROM demographic WHERE demographic.name = "Stephanie Suchan"
### Instruction: 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, d...
SELECT demographic.dob FROM demographic WHERE demographic.name = "Kelly Gallardo"
### Instruction: 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, d...
SELECT demographic.age FROM demographic WHERE demographic.name = "Jerry Deberry"
### Instruction: CREATE TABLE diagnoses ( 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, ...
SELECT demographic.religion FROM demographic WHERE demographic.name = "Josette Orr"
### Instruction: 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 ) CREATE TABLE prescriptions ( subject_id ...
SELECT demographic.dob FROM demographic WHERE demographic.name = "Paul Edwards"
### Instruction: CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE TABLE profess...
SELECT COUNT(DISTINCT dept_name) FROM department
### Instruction: 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, lon...
SELECT demographic.gender FROM demographic WHERE demographic.name = "Tiffany Williams"
### Instruction: CREATE TABLE candidates ( candidate_id number, candidate_details text ) CREATE TABLE students ( student_id number, student_details text ) CREATE TABLE people ( person_id number, first_name text, middle_name text, last_name text, cell_mobile_number text, email_a...
SELECT T2.first_name, T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id
### Instruction: CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_p...
SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM customers
### Instruction: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, ...
SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Paul Edwards"
### Instruction: 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 ) CREATE T...
SELECT demographic.religion FROM demographic WHERE demographic.name = "Paul Edwards"
### Instruction: 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, lo...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F"
### Instruction: CREATE TABLE customers ( customer_id number, customer_name text, customer_details text ) CREATE TABLE products ( product_id number, product_name text, product_details text ) CREATE TABLE shipments ( shipment_id number, order_id number, invoice_number number, sh...
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T3.order_item_status = "Cancel" AND T4.product_name = "food" GROUP BY T1.customer_id HAVING COUNT(*) >= 1
### Instruction: CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class...
SELECT COUNT(DISTINCT school_code) FROM department
### Instruction: CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob...
SELECT COUNT(DISTINCT dept_name) FROM department
### Instruction: 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, adm...
SELECT demographic.gender FROM demographic WHERE demographic.name = "Jerry Deberry"
### Instruction: 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, adm...
SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Michael Witt"
### Instruction: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, ...
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Paul Edwards"
### Instruction: CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff tim...
SELECT nickname FROM staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
### Instruction: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, ...
SELECT demographic.language FROM demographic WHERE demographic.name = "Jerry Deberry"
### Instruction: CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE course ( course_id text, title text, dept_name text, credits...
SELECT COUNT(*) FROM classroom WHERE building <> 'Lamberton'
### Instruction: CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Claims ( Claim_ID INTEGER, ...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) ORDER BY COUNT(Date_Claim_Made) DESC
### Instruction: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, ...
SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Orville Ford"
### Instruction: CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min number ) CREATE TABLE takes ( id text, course_i...
SELECT year FROM section GROUP BY year ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE course ( course_id text, title text, dept_name text, credits number )...
SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton'
### Instruction: CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, lesson_date time, lesson_time text, price number ) CREATE TABLE staff ( ...
SELECT date_joined_staff FROM staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
### Instruction: CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CRE...
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'reinforcement learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpape...
### Instruction: CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( ...
SELECT DISTINCT COUNT(paper.paperid), keyphrase.keyphraseid FROM keyphrase, paper, paperkeyphrase, venue WHERE paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' GROUP BY keyphrase.keyphraseid ...
### Instruction: CREATE TABLE field ( fieldid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CRE...
SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'emina torlak' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid
### Instruction: CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE professor ( emp_num number, dept_cod...
SELECT COUNT(DISTINCT class_code) FROM class
### Instruction: CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CR...
SELECT Document_Type_Name, COUNT(Document_Type_Name) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY Document_Type_Name DESC
### Instruction: CREATE TABLE domain_journal ( did int, jid int ) CREATE TABLE journal ( homepage varchar, jid int, name varchar ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE domain ( did int, name varchar ) CREATE TABLE keyword ( keyword varchar, kid in...
SELECT domain.name FROM conference, domain, domain_conference WHERE conference.name = 'VLDB' AND domain_conference.cid = conference.cid AND domain.did = domain_conference.did
### Instruction: CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperdataset ( paperid int, ...
SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename IN ('Multiuser Receiver', 'Decision Feedback') AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.paperid, paper.year HAVING COUNT(DISTINCT keyphras...
### Instruction: CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TABLE section ( course_id text, sec_id text, semester text, year number,...
SELECT DISTINCT name FROM instructor ORDER BY name
### Instruction: CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABL...
SELECT DISTINCT COUNT(cite.citingpaperid) FROM author, cite, keyphrase, paperkeyphrase, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid AND writ...
### Instruction: CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min numbe...
SELECT COUNT(*), dept_name FROM student GROUP BY dept_name
### Instruction: CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, ...
SELECT business.name FROM business, category AS CATEGORY_0, category AS CATEGORY_1 WHERE business.city = 'Dallas' AND business.rating > 3.5 AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'Mexican' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'restaur...
### Instruction: CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_descriptio...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Sales AS T1 JOIN Transactions AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 ORDER BY date_of_transaction DESC
### Instruction: CREATE TABLE roles ( role_code text, role_name text, role_description text ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE employees ( employee_id number, role_code text, employee_n...
SELECT T2.day_number, T1.date_stored FROM all_documents AS T1 JOIN ref_calendar AS T2 ON T1.date_stored = T2.calendar_date
### Instruction: CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE teaches ( id text, course_id text, sec_id text, ...
SELECT title FROM course ORDER BY title, credits
### Instruction: 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, d...
SELECT demographic.dob FROM demographic WHERE demographic.name = "Shawn Green"
### Instruction: CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) ...
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Semantic Segmentation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpaper...
### Instruction: CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR...
SELECT Budget_Type_Description, COUNT(Budget_Type_Description) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY Budget_Type_Description
### Instruction: CREATE TABLE draft_copies ( document_id number, draft_number number, copy_number number ) CREATE TABLE ref_shipping_agents ( shipping_agent_code text, shipping_agent_name text, shipping_agent_description text ) CREATE TABLE employees ( employee_id number, role_code tex...
SELECT COUNT(*) FROM documents WHERE document_status_code = "done"
### Instruction: CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min number ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE course ( course_id text, ...
SELECT year FROM section GROUP BY year ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) CREATE TABLE student ( id text, n...
SELECT COUNT(DISTINCT dept_name) FROM course
### Instruction: CREATE TABLE draft_copies ( document_id number, draft_number number, copy_number number ) CREATE TABLE documents_mailed ( document_id number, mailed_to_address_id number, mailing_date time ) CREATE TABLE documents ( document_id number, document_status_code text, do...
SELECT role_description FROM roles WHERE role_code = "ED"
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE author...
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year > 2005 AND writes.paperid = paper.paperid GROUP BY write...
### Instruction: CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longitude varchar, review_count bigint, is_open tinyint...
SELECT business.name FROM business, category AS CATEGORY_0, category AS CATEGORY_1 WHERE business.city = 'Dallas' AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'restaurant' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'Indian' ORDER BY business.revi...
### Instruction: CREATE TABLE field ( fieldid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasenam...
SELECT DISTINCT author.authorname, cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname IN ('tom mitchell', 'oren etzioni') AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid, author.au...
### Instruction: CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varc...
SELECT DISTINCT cite.citingpaperid FROM cite, keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'Euclidean Distance' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = cite.citingpaperid AND paper.paperid = cite.citedpaperid AND venue.venueid = paper.venueid AND ve...
### Instruction: CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Acc...
SELECT Document_Type_Name, COUNT(Document_Type_Name) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY Document_Type_Name
### Instruction: CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperdataset ( paperid int, data...
SELECT DISTINCT writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename IN ('IBD', 'diet') AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year > 2011 AND writes.paperid = paper.paperid GROUP BY writes.authorid
### Instruction: CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) ...
SELECT DISTINCT paper.title FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname LIKE 'Ranjit Jhala' AND keyphrase.keyphrasename = 'Liquid Haskell' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid AND writes...
### Instruction: CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE domain_conference ( cid int, did int ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE dom...
SELECT SUM(publication.citation_num) FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.jid = journal.jid
### Instruction: CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots text, needed text, votes text, inducted text, category text, needed_note text ) CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, ...
SELECT award_id FROM player_award AS T1 JOIN salary AS T2 ON T1.player_id = T2.player_id GROUP BY T1.award_id ORDER BY AVG(T2.salary) DESC LIMIT 1
### Instruction: CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TA...
SELECT COUNT(DISTINCT id) FROM teaches
### Instruction: CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, lesson_date time, lesson_time text, price number ) CREATE TABLE customers ( customer_id number, customer_address_id number, customer_sta...
SELECT date_became_customer FROM customers WHERE first_name = "Carole" AND last_name = "Bernhard"
### Instruction: CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Stateme...
SELECT Document_Date, COUNT(Document_Date) FROM Documents AS T1 JOIN Projects AS T2 ON T1.Project_ID = T2.Project_ID WHERE T2.Project_Details = 'Graph Database project'
### Instruction: CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY Document_Date
### Instruction: CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), D...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY Document_Date DESC
### Instruction: CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Inves...
SELECT sales_details, COUNT(sales_details) FROM Sales AS T1 JOIN Transactions AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 GROUP BY sales_details ORDER BY COUNT(sales_details) DESC
### Instruction: CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE time_slot ( time_slot_id ...
SELECT dept_name FROM department ORDER BY budget LIMIT 1
### Instruction: CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE keyphrase ( keyphraseid int, ...
SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'philipp koehn' AND keyphrase.keyphrasename = 'Machine Translation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = autho...
### Instruction: CREATE TABLE circulation_history ( document_id number, draft_number number, copy_number number, employee_id number ) CREATE TABLE ref_shipping_agents ( shipping_agent_code text, shipping_agent_name text, shipping_agent_description text ) CREATE TABLE addresses ( addres...
SELECT document_status_code FROM ref_document_status
### Instruction: CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_I...
SELECT Document_Date, COUNT(Document_Date) FROM Documents AS T1 JOIN Projects AS T2 ON T1.Project_ID = T2.Project_ID WHERE T2.Project_Details = 'Graph Database project'
### Instruction: CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) CREATE TABLE department ( dept_name text, building text, budget number ) CREATE TABLE student ( id text, name text, ...
SELECT COUNT(DISTINCT dept_name) FROM course
### Instruction: CREATE TABLE department ( dept_name text, building text, budget number ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE instructor ( id text, name text, d...
SELECT COUNT(DISTINCT s_id) FROM advisor
### Instruction: CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Oth...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY COUNT(Document_Date)
### Instruction: CREATE TABLE candidates ( candidate_id number, candidate_details text ) CREATE TABLE student_course_attendance ( student_id number, course_id number, date_of_attendance time ) CREATE TABLE candidate_assessments ( candidate_id number, qualification text, assessment_date...
SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id
### Instruction: CREATE TABLE table_test_8 ( "id" int, "anemia" bool, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "intravenous_pressors" bool, "fever" bool, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "vasopressors" bool, "renal_disease" bool...
SELECT * FROM table_test_8 WHERE estimated_glomerular_filtration_rate_egfr <= 30 OR serum_creatinine >= 220
### Instruction: CREATE TABLE rent_arrears ( council_tax_id number, cmi_cross_ref_id number ) CREATE TABLE council_tax ( council_tax_id number, cmi_cross_ref_id number ) CREATE TABLE customer_master_index ( master_customer_id number, cmi_details text ) CREATE TABLE cmi_cross_references ( ...
SELECT T1.council_tax_id FROM rent_arrears AS T1 JOIN cmi_cross_references AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id JOIN customer_master_index AS T3 ON T3.master_customer_id = T2.master_customer_id WHERE T3.cmi_details <> 'Schmidt , Kertzmann and Lubowitz'
### Instruction: CREATE TABLE table_test_23 ( "id" int, "previous_mi" bool, "anemia" bool, "left_ventricular_ejection_fraction_lvef" int, "tolerate_gadolinium_contrast_media" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, ...
SELECT * FROM table_test_23 WHERE tolerate_magnetic_resonance_imaging = 0 OR body_mass_index_bmi > 35 OR tolerate_gadolinium_contrast_media = 0 OR creatinine_clearance_cl < 60
### Instruction: CREATE TABLE field ( fieldid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasenam...
SELECT DISTINCT COUNT(DISTINCT author.authorid) FROM author, writes WHERE author.authorname <> 'Mark Steedman' AND writes.authorid = author.authorid AND writes.paperid IN (SELECT WRITESalias1.paperid FROM author AS AUTHORalias1, writes AS WRITESalias1 WHERE AUTHORalias1.authorname = 'Mark Steedman' AND WRITESalias1.aut...
### Instruction: CREATE TABLE domain_publication ( did int, pid int ) CREATE TABLE author ( aid int, homepage varchar, name varchar, oid int ) CREATE TABLE organization ( continent varchar, homepage varchar, name varchar, oid int ) CREATE TABLE domain_conference ( cid int,...
SELECT COUNT(DISTINCT (publication.title)) FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.jid = journal.jid
### Instruction: CREATE TABLE field ( fieldid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasenam...
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'sentiment analysis' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpaperid ...
### Instruction: CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Stateme...
SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_Details DESC
### Instruction: CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_name text, password text, personal_name text, middle_name text, family_name text, gender_mf text, address_line_1 text ) CREATE TABLE subjects ( subject_id number, subject...
SELECT T1.personal_name, T1.family_name, T2.author_id FROM course_authors_and_tutors AS T1 JOIN courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE Available_Policies ( Policy_ID INTEGER, policy_type_code CHAR(15), Customer_Phone VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_name VARCHAR(40) ) CREATE TABLE Customers_Policies ( Customer_ID INTEGER, Policy_ID INTEGER, Date_Opened DA...
SELECT Date_Closed, COUNT(Date_Closed) FROM Customers AS t1 JOIN Customers_Policies AS t2 ON t1.Customer_ID = t2.Customer_ID WHERE t1.Customer_name LIKE "%Diana%" ORDER BY COUNT(Date_Closed)
### Instruction: CREATE TABLE table_203_54 ( id number, "selected\nlatin american\ncountries" text, "internl.\ntourism\narrivals\n2010\n(x 1000)" number, "internl.\ntourism\nreceipts.\n2010\n(usd\n(x1000)" number, "average\nreceipt\nper visitor\n2009\n(usd/turista)" number, "tourist\narrivals\np...
SELECT "average\nreceipt\nper visitor\n2009\n(usd/turista)" FROM table_203_54 WHERE "selected\nlatin american\ncountries" = 'brazil'
### Instruction: CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Doc...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description
### Instruction: CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciti...
SELECT DISTINCT COUNT(paper.paperid) FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL'
### Instruction: CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Bu...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name
### Instruction: CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, jour...
SELECT DISTINCT dataset.datasetid, paper.year FROM dataset, keyphrase, paper, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'deep learning' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid AND paper.pap...
### Instruction: CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ...
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code
### Instruction: CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details...
SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = "SALE" ORDER BY T1.Investor_details DESC
### Instruction: CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE dataset ( datasetid int, datasetname va...
SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Ed Desmond' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.auth...
### Instruction: CREATE TABLE table_test_14 ( "id" int, "bleeding" int, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "haemoglobin" float, "severe_hypertension" bool, "platelets" int, "neutrophil_count" int, "renal_disease" bool, "severe_thrombocytopen...
SELECT * FROM table_test_14 WHERE neutropenia = 1 OR neutrophil_count < 1000 OR severe_thrombocytopenia = 1 OR platelets < 50000
### Instruction: CREATE TABLE salary ( year number, team_id text, league_id text, player_id text, salary number ) CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, tie text, notes text ) CREATE TABLE player_award_vote ( award_id tex...
SELECT T2.salary FROM salary AS T2 JOIN hall_of_fame AS T1 ON T1.player_id = T2.player_id WHERE T1.inducted = "Y"
### Instruction: CREATE TABLE table_21836 ( "Rank" real, "County" text, "State" text, "Land area (km\u00b2)" text, "Land area (mi\u00b2)" text, "April 1, 2010 census" real, "April 1, 2010 density (/km\u00b2)" real, "April 1, 2010 density (/mi\u00b2)" real, "July 1, 2010 official esti...
SELECT COUNT("State") FROM table_21836 WHERE "July 1, 2010 density (/mi\u00b2)" = '1209'
### Instruction: CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, ...
SELECT customer_last_name, COUNT(customer_last_name) FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id GROUP BY customer_last_name
### Instruction: CREATE TABLE claims_processing ( claim_processing_id number, claim_id number, claim_outcome_code text, claim_stage_id number, staff_id number ) CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE policies ( policy_id number, customer_i...
SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id = t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Ref_Transaction_Typ...
SELECT Investor_details, COUNT(Investor_details) FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100 GROUP BY Investor_details ORDER BY Investor_details
### Instruction: CREATE TABLE domain_journal ( did int, jid int ) CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE organization ( continent varchar, homepage varchar, name varchar, oid int ) C...
SELECT conference.name FROM conference, publication WHERE publication.cid = conference.cid AND publication.title = 'Making database systems usable'