instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### 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 Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Docume...
SELECT Project_ID, COUNT(*) FROM Documents GROUP BY Project_ID
### Instruction: CREATE TABLE table_test_25 ( "id" int, "ejection_fraction_ef" int, "respiratory_tract_infection" bool, "left_ventricular_ejection_fraction_lvef" int, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "central_diabetes_insipidus" bool, "hyponatremi...
SELECT * FROM table_test_25 WHERE heart_disease = 1
### Instruction: CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE field ( fieldid int ) CR...
SELECT DISTINCT writes.paperid FROM author, paper, writes WHERE author.authorname = 'emina torlak' AND paper.year >= YEAR(CURDATE()) - 10 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE writes ( ...
SELECT DISTINCT paper.paperid, paper.year FROM author, paper, writes WHERE author.authorname = 'Mirella Lapata' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC LIMIT 5
### Instruction: CREATE TABLE member_of ( facid number, dno number, appt_type text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE department ( dno number, division text...
SELECT T2.fname, T2.lname FROM minor_in AS T1 JOIN student AS T2 ON T1.stuid = T2.stuid WHERE T1.dno = 140
### Instruction: CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABL...
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM Has_amenity AS T3 JOIN Dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') GROUP BY Fname ORDER BY Fname
### Instruction: CREATE TABLE airport_aircraft ( ID int, Airport_ID int, Aircraft_ID int ) CREATE TABLE airport ( Airport_ID int, Airport_Name text, Total_Passengers real, %_Change_2007 text, International_Passengers real, Domestic_Passengers real, Transit_Passengers real, A...
SELECT Aircraft, COUNT(Aircraft) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY Aircraft ORDER BY Aircraft
### Instruction: CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE writes ( paperid int, ...
SELECT DISTINCT paperdataset.datasetid FROM author, paper, paperdataset, writes WHERE author.authorname = 'oren etzioni' AND paper.paperid = paperdataset.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### 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 Investors ( investor_id INTEGER, Investor_details VARCHAR(2...
SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code ORDER BY AVG(amount_of_transaction) DESC
### Instruction: CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, ...
SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements
### Instruction: CREATE TABLE field ( fieldid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREA...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'dependent types' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'reinforcement learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### Instruction: CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int...
SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname IN ('WordNet', 'Dbpedia') AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid GROUP BY paper.paperid
### 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.venueid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### 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 dataset.datasetid FROM dataset, paper, paperdataset, venue WHERE paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid AND venue.venueid = paper.venueid AND venue.venuename = 'icml'
### Instruction: CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, ...
SELECT SUM(checkin.count) FROM business, checkin, neighborhood WHERE checkin.business_id = business.business_id AND neighborhood.business_id = business.business_id AND neighborhood.neighborhood_name = 'Brighton Heights'
### Instruction: CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEG...
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM Has_amenity AS T3 JOIN Dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') GROUP BY Fname ORDER BY Fname DESC
### Instruction: CREATE TABLE locations ( location_id number, street_address text, postal_code text, city text, state_province text, country_id text ) CREATE TABLE regions ( region_id number, region_name text ) CREATE TABLE jobs ( job_id text, job_title text, min_salary num...
SELECT department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name
### Instruction: CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) 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 ...
SELECT tip.text FROM business, tip WHERE business.name = 'Cafe Zinho' AND business.state = 'Pennsylvania' AND tip.business_id = business.business_id AND tip.year = 2010
### Instruction: CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artis...
SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla" GROUP BY T1.country ORDER BY T1.country
### Instruction: CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, a...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'Aida Kasumovic' AND paper.year = 2015 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int, month varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE neighborhood ( id int, business_id va...
SELECT neighborhood.name FROM business, neighborhood, review, user WHERE neighborhood.business_id = business.business_id AND review.business_id = business.business_id AND user.name = 'Michelle' AND user.user_id = review.user_id
### Instruction: CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) ...
SELECT DISTINCT paper.journalid, venue.venueid FROM author, paper, venue, writes WHERE author.authorname = 'li dong' AND venue.venueid = paper.venueid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE field ( fieldid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CRE...
SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname IN ('WordNet', 'Dbpedia') AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid GROUP BY paper.paperid
### Instruction: CREATE TABLE document_sections_images ( section_id number, image_id number ) CREATE TABLE images ( image_id number, image_alt_text text, image_name text, image_url text ) CREATE TABLE document_sections ( section_id number, document_code text, section_sequence numbe...
SELECT image_name, image_url FROM images ORDER BY image_name
### Instruction: CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Transactions ( tr...
SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code ORDER BY AVG(amount_of_transaction)
### Instruction: CREATE TABLE shipment_items ( shipment_id number, order_item_id number ) CREATE TABLE invoices ( invoice_number number, invoice_date time, invoice_details text ) CREATE TABLE order_items ( order_item_id number, product_id number, order_id number, order_item_status ...
SELECT invoice_number FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25"
### Instruction: CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) 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 Transaction...
SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code ORDER BY transaction_type_code DESC
### Instruction: CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements
### Instruction: CREATE TABLE table_57409 ( "Crew" real, "Year 10 1st Quad" text, "Year 10 2nd Quad" text, "Year 10 3rd Quad" text, "Year 10 4th Quad" text, "Year 10 Single Scull" text, "Year 9 1st Quad" text, "Year 9 2nd Quad" text, "Year 9 3rd Quad" text, "Year 9 4th Quad" text...
SELECT "Year 8 1st Quad" FROM table_57409 WHERE "Year 9 2nd Quad" = 'stm' AND "Year 9 1st Quad" = 'som' AND "Year 8 3rd Quad" = 'sta'
### Instruction: CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(4...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions ORDER BY date_of_transaction
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperfield ( fieldid int...
SELECT DISTINCT paper.paperid FROM author, cite, paper, writes WHERE author.authorname = 'oren etzioni' AND paper.paperid = cite.citingpaperid AND writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid
### Instruction: CREATE TABLE contacts ( contact_id number, customer_id number, gender text, first_name text, last_name text, contact_phone text ) CREATE TABLE order_items ( order_item_id number, order_id number, product_id number, order_quantity text ) CREATE TABLE addresses (...
SELECT MIN(product_price), MAX(product_price), AVG(product_price) FROM products
### Instruction: CREATE TABLE aircraft ( Aircraft_ID int(11), Aircraft varchar(50), Description varchar(50), Max_Gross_Weight varchar(50), Total_disk_area varchar(50), Max_disk_Loading varchar(50) ) CREATE TABLE match ( Round real, Location text, Country text, Date text, Fas...
SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft
### 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 anemia = 1 OR hb < 8.5 OR thrombocytopenia = 1 OR platelet_count < 100000
### 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 Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Transactions ( ...
SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction
### Instruction: CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) 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 write...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'counting crowd' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### Instruction: CREATE TABLE customer_orders ( order_id number, customer_id number, order_date time, order_status_code text ) CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREAT...
SELECT state_province_county, COUNT(*) FROM addresses GROUP BY state_province_county
### 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 paperkeyphrase ( paperid int,...
SELECT DISTINCT paper.paperid, paper.year FROM author, paper, writes WHERE author.authorname = 'balakrishnan prabhakaran' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: 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 journal ( journalid int, journalname varchar ) CREATE TABLE datase...
SELECT DISTINCT journal.journalid FROM author, journal, paper, writes WHERE author.authorname = 'Li Dong' AND paper.journalid = journal.journalid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fiel...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### 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 Settlements ( Settlement_ID ...
SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code
### Instruction: CREATE TABLE table_train_128 ( "id" int, "vascular" bool, "mania" bool, "pulmonary_disease" bool, "cardiac" bool, "stroke" bool, "substance_dependence" bool, "schizophrenia" bool, "cerebrovascular_disease" bool, "hematologic_disease" bool, "adverse_reactions_...
SELECT * FROM table_train_128 WHERE cerebrovascular_disease = 1 OR ((CASE WHEN stroke = 1 THEN 1 ELSE 0 END + CASE WHEN neuropathology = 1 THEN 1 ELSE 0 END) >= 1)
### Instruction: CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, au...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'linda shapiro' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TA...
SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla" GROUP BY T1.country ORDER BY T1.country DESC
### Instruction: CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE cite ( citingpaperid int, ...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'autoencoder' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### Instruction: CREATE TABLE locations ( location_id number, street_address text, postal_code text, city text, state_province text, country_id text ) CREATE TABLE countries ( country_id text, country_name text, region_id number ) CREATE TABLE job_history ( employee_id number, ...
SELECT employee_id, salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam')
### Instruction: CREATE TABLE table_test_32 ( "id" int, "anemia" bool, "symptomatic_disease" bool, "language" string, "deceased" bool, "abdominal_pain" bool, "fever" bool, "arthralgia" bool, "unable_provide_consent" bool, "headache" bool, "myalgia" bool, "rash" bool, ...
SELECT * FROM table_test_32 WHERE symptomatic_disease = 1 OR (symptomatic_lymphadenopathy = 1 OR hepatomegaly = 1 OR splenomegaly = 1 OR anemia = 1 OR hb < 110)
### Instruction: CREATE TABLE order_items ( order_item_id number, product_id number, order_id number, order_item_status text, order_item_details text ) CREATE TABLE shipment_items ( shipment_id number, order_item_id number ) CREATE TABLE shipments ( shipment_id number, order_id num...
SELECT T3.product_name, COUNT(*) FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id
### Instruction: CREATE TABLE customer_contact_channels ( customer_id number, channel_code text, active_from_date time, active_to_date time, contact_number text ) CREATE TABLE products ( product_id number, product_details text ) CREATE TABLE order_items ( order_id number, product_i...
SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1)
### Instruction: CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TA...
SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code ORDER BY transaction_type_code DESC
### Instruction: CREATE TABLE ref_colors ( color_code text, color_description text ) CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_cha...
SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM characteristics EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM characteristics AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id
### Instruction: 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 journal ( journalid int, journalname varchar ) CREATE TABLE datase...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Computer Model' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### Instruction: CREATE TABLE table_dev_24 ( "id" int, "active_ocular_disease" bool, "systolic_blood_pressure_sbp" int, "active_infection" bool, "hemoglobin_a1c_hba1c" float, "body_weight" float, "diabetic" string, "seasonal_allergy" bool, "retinal_nerve_disease" bool, "diastolic...
SELECT * FROM table_dev_24 WHERE diabetic = 'ii' OR (glycohemoglobin >= 7.5 AND glycohemoglobin <= 10.5 AND fasting_insulin < 40)
### Instruction: CREATE TABLE job_history ( employee_id number, start_date time, end_date time, job_id text, department_id number ) CREATE TABLE countries ( country_id text, country_name text, region_id number ) CREATE TABLE departments ( department_id number, department_name t...
SELECT first_name, last_name FROM employees WHERE department_id = 70 OR department_id = 90
### Instruction: CREATE TABLE airport ( Airport_ID int, Airport_Name text, Total_Passengers real, %_Change_2007 text, International_Passengers real, Domestic_Passengers real, Transit_Passengers real, Aircraft_Movements real, Freight_Metric_Tonnes real ) CREATE TABLE match ( Roun...
SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft
### Instruction: CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABL...
SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, writes WHERE author.authorname = 'Mirella Lapata' AND writes.authorid = author.authorid AND writes.paperid = cite.citingpaperid
### Instruction: CREATE TABLE jobs ( job_id text, job_title text, min_salary number, max_salary number ) CREATE TABLE countries ( country_id text, country_name text, region_id number ) CREATE TABLE locations ( location_id number, street_address text, postal_code text, city ...
SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000
### Instruction: CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Statemen...
SELECT Account_ID, Account_Details FROM Accounts
### 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 Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Trans...
SELECT Investor_details, COUNT(Investor_details) FROM Investors GROUP BY Investor_details ORDER BY Investor_details DESC
### Instruction: CREATE TABLE job_history ( employee_id number, start_date time, end_date time, job_id text, department_id number ) CREATE TABLE employees ( employee_id number, first_name text, last_name text, email text, phone_number text, hire_date time, job_id text, ...
SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int...
SELECT DISTINCT paper.journalid FROM author, paper, writes WHERE author.authorname = 'Donald E Knuth' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.journalid
### Instruction: CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(2...
SELECT investor_id, COUNT(*) FROM Transactions WHERE transaction_type_code = "SALE" GROUP BY investor_id
### Instruction: CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE courses ( course_id number, author_id number, subject_id number, course_name text, course_description text ) CREATE TABLE students ( student_id number, date_of_registration time, date_o...
SELECT personal_name FROM course_authors_and_tutors INTERSECT SELECT personal_name FROM students
### 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 COUNT(DISTINCT paper.paperid) FROM dataset, paper, paperdataset WHERE dataset.datasetname LIKE 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid
### Instruction: CREATE TABLE job_history ( employee_id number, start_date time, end_date time, job_id text, department_id number ) CREATE TABLE countries ( country_id text, country_name text, region_id number ) CREATE TABLE regions ( region_id number, region_name text ) CREAT...
SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC
### Instruction: CREATE TABLE guests ( guest_id number, gender_code text, guest_first_name text, guest_last_name text, date_of_birth time ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, bathroom_count number, bedroom_count ...
SELECT building_address, building_phone FROM apartment_buildings WHERE building_manager = "Brenden"
### Instruction: CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid in...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'li dong' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE field ( fieldid...
SELECT DISTINCT writes.authorid FROM paper, venue, writes WHERE paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'acl' AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE problems ( problem_id number, product_id number, closure_authorised_by_staff_id number, reported_by_staff_id number, date_problem_reported time, date_problem_closed time, problem_description text, other_problem_details text ) CREATE TABLE problem_log ( ...
SELECT problem_log_id, log_entry_date FROM problem_log WHERE problem_id = 10
### Instruction: CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE artist ( artist_name var...
SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla" GROUP BY T1.country ORDER BY T1.country DESC
### Instruction: CREATE TABLE courses ( course_id number, author_id number, subject_id number, course_name text, course_description text ) CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, persona...
SELECT test_result, COUNT(*) FROM student_tests_taken GROUP BY test_result ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE customer_addresses ( customer_id number, address_id number, date_address_from time, address_type text, date_address_to time ) CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ...
SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20
### Instruction: CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id number, card_id number, transaction_type text, transaction_date time, transaction_amount number, transaction_comment text, other_transaction_details text ) CREATE...
SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM customers_cards AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.card_number = "4560596484842"
### Instruction: CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperdatas...
SELECT DISTINCT COUNT(paper.paperid) FROM paper, venue WHERE paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename = 'nature communications'
### Instruction: CREATE TABLE document_structures ( document_structure_code text, parent_document_structure_code text, document_structure_description text ) CREATE TABLE document_sections_images ( section_id number, image_id number ) CREATE TABLE document_sections ( section_id number, docu...
SELECT COUNT(*) FROM users WHERE user_login = 1
### 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 writes.authorid FROM paper, venue, writes WHERE paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid
### 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 cite.citingpaperid FROM cite, paper WHERE paper.paperid = cite.citedpaperid GROUP BY cite.citingpaperid HAVING COUNT(DISTINCT cite.citedpaperid) >= 5
### Instruction: CREATE TABLE job_history ( employee_id number, start_date time, end_date time, job_id text, department_id number ) CREATE TABLE countries ( country_id text, country_name text, region_id number ) CREATE TABLE jobs ( job_id text, job_title text, min_salary nu...
SELECT department_id, AVG(salary) FROM employees WHERE commission_pct <> "null" GROUP BY department_id
### Instruction: CREATE TABLE addresses ( address_id number, address_content text, city text, zip_postcode text, state_province_county text, country text, other_address_details text ) CREATE TABLE customers ( customer_id number, payment_method text, customer_name text, date_...
SELECT COUNT(DISTINCT customer_id) FROM customer_orders WHERE order_status = "Cancelled"
### Instruction: CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE writes ( paperid...
SELECT DISTINCT COUNT(paper.paperid) FROM paper, venue WHERE paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'sigcse'
### Instruction: CREATE TABLE customer_policies ( policy_id number, customer_id number, policy_type_code text, start_date time, end_date time ) CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE payments ( payment_id number, settlement_id number, ...
SELECT T1.claim_id, T1.date_claim_made, T1.date_claim_settled FROM claims AS T1 JOIN settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id HAVING COUNT(*) = 1
### Instruction: CREATE TABLE business_rates ( business_rates_id number, cmi_cross_ref_id number ) CREATE TABLE parking_fines ( council_tax_id number, cmi_cross_ref_id number ) CREATE TABLE benefits_overpayments ( council_tax_id number, cmi_cross_ref_id number ) CREATE TABLE cmi_cross_referen...
SELECT T1.cmi_details FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax'
### Instruction: CREATE TABLE regions ( region_id number, region_name text ) CREATE TABLE job_history ( employee_id number, start_date time, end_date time, job_id text, department_id number ) CREATE TABLE jobs ( job_id text, job_title text, min_salary number, max_salary num...
SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperfield ( fieldid int...
SELECT DISTINCT cite.citingpaperid FROM cite, paper WHERE paper.paperid = cite.citedpaperid GROUP BY cite.citingpaperid HAVING COUNT(DISTINCT cite.citedpaperid) >= 5
### Instruction: CREATE TABLE student_tests_taken ( registration_id number, date_test_taken time, test_result text ) 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_nam...
SELECT date_of_enrolment, date_of_completion FROM student_course_enrolment
### Instruction: CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE author ( authorid in...
SELECT DISTINCT paper.year FROM author, paper, writes WHERE author.authorname = 'Pedro Domingos' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.year
### Instruction: CREATE TABLE apartment_buildings ( building_id number, building_short_name text, building_full_name text, building_description text, building_address text, building_manager text, building_phone text ) CREATE TABLE apartment_facilities ( apt_id number, facility_code ...
SELECT date_of_birth FROM guests WHERE gender_code = "Male"
### Instruction: CREATE TABLE table_dev_14 ( "id" int, "anemia" bool, "pulmonary_disease" bool, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "cardiovascular_disease" bool, "estimated_glomerular_filtration_rate_egfr" int, "fasting_c_peptide" float, ...
SELECT * FROM table_dev_14 WHERE organ_failure = 1 OR pulmonary_disease = 1 OR cardiovascular_disease = 1 OR anemia = 1 OR hemoglobin_a1c_hba1c < 10 OR renal_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 60
### Instruction: CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) ...
SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM paper, venue WHERE paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL'
### Instruction: CREATE TABLE apartment_bookings ( apt_booking_id number, apt_id number, guest_id number, booking_status_code text, booking_start_date time, booking_end_date time ) CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE guests ( guest_i...
SELECT booking_start_date, booking_end_date FROM apartment_bookings
### Instruction: CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Inves...
SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code ORDER BY transaction_type_code
### 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 paperkeyphrase ( paperid int,...
SELECT DISTINCT writes.paperid FROM author, paper, writes WHERE author.authorname = 'emo todorov' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC
### Instruction: 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 Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Ref_T...
SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details ORDER BY lot_details DESC
### 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 Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Transactions ( ...
SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details ORDER BY lot_details
### Instruction: CREATE TABLE table_test_10 ( "id" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "immunosuppressive_disease" bool, "systolic_arterial_pressure_sap" int, "lymphomas" bool, "left_ventricular_dysfunction" bool, "tissue_hypoperfusion" ...
SELECT * FROM table_test_10 WHERE left_ventricular_ejection_fraction_lvef = 1 AND pci <= 40
### Instruction: CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time ) CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_name text, password text, ...
SELECT login_name FROM course_authors_and_tutors INTERSECT SELECT login_name FROM students
### Instruction: CREATE TABLE minor_in ( stuid number, dno number ) CREATE TABLE gradeconversion ( lettergrade text, gradepoint number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CR...
SELECT dname FROM department EXCEPT SELECT T1.dname FROM department AS T1 JOIN minor_in AS T2 ON T1.dno = T2.dno
### Instruction: CREATE TABLE table_dev_44 ( "id" int, "gender" string, "arterial_ph" float, "systolic_blood_pressure_sbp" int, "serum_bicarbonate" int, "anion_gap" int, "diabetic" string, "diabetic_ketoacidosis" bool, "blood_glucose" int, "diastolic_blood_pressure_dbp" int, ...
SELECT * FROM table_dev_44 WHERE diabetic_ketoacidosis = 1 OR (arterial_ph < 7.24 OR serum_bicarbonate < 15 OR positive_serum_ketones = 1 OR anion_gap > 12)
### Instruction: CREATE TABLE table_dev_20 ( "id" int, "anemia" bool, "gender" string, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "platelets" int, "dyslipidemia" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "neutropenia" int, "estimated_g...
SELECT * FROM table_dev_20 WHERE dyslipidemia = 1 OR (triglyceride_tg > 800 OR ldl > 200)