instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### 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 writes.paperid FROM author, paper, writes WHERE author.authorname = 'richard anderson' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC
### Instruction: CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE tip ( tip_id int, business_id varc...
SELECT business.name FROM business, review WHERE review.business_id = business.business_id AND review.month = 'April' GROUP BY business.name ORDER BY COUNT(DISTINCT (review.text)) DESC LIMIT 1
### Instruction: CREATE TABLE subjects ( subject_id number, subject_name 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_name text, gender_mf text, address_l...
SELECT date_test_taken FROM student_tests_taken WHERE test_result = "Pass"
### Instruction: CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction...
SELECT investor_id, AVG(share_count) FROM Transactions GROUP BY investor_id ORDER BY AVG(share_count)
### Instruction: CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varc...
SELECT DISTINCT COUNT(paper.paperid) FROM paper, venue WHERE paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'sigmod'
### 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 apartments ( apt_id number, building_id number, ...
SELECT COUNT(*) FROM apartments WHERE NOT apt_id IN (SELECT apt_id FROM apartment_facilities)
### Instruction: CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE category ( id int, business_id var...
SELECT business.city FROM business, category WHERE business.name = 'MGM Grand Buffet' AND category.business_id = business.business_id AND category.category_name = 'restaurant'
### Instruction: CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating number(10), languages varchar2(20), releasedate Date, resolution number(10) ) CREATE TABLE artist ( artist_name varchar2(50...
SELECT MIN(T1.duration), MIN(T2.rating) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY MIN(T1.duration) ORDER BY MIN(T2.rating)
### Instruction: CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_selling_price text, product_description text, other_product_details text ) CREATE TABLE ref_colors ( color_code text, co...
SELECT t3.characteristic_name, t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "cumin"
### Instruction: CREATE TABLE table_62375 ( "1999/ 00" text, "2000/ 01" text, "2001/ 02" text, "2002/ 03" text, "2003/ 04" text, "2004/ 05" text, "2005/ 06" text, "2006/ 07" text, "2007/ 08" text, "2008/ 09" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, ...
SELECT "2006/ 07" FROM table_62375 WHERE "2011/ 12" = 'tournament not held' AND "2005/ 06" = 'tournament not held' AND "2002/ 03" = '1r'
### Instruction: CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE tip ( tip_id int, business_id varchar, ...
SELECT COUNT(DISTINCT (business.name)) FROM business, category WHERE business.city = 'Edinburgh' AND category.business_id = business.business_id AND category.category_name = 'Pet Groomers'
### Instruction: 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, rating float, state varchar ) CREATE TABLE review ( rid int, business_i...
SELECT business.name FROM business, category WHERE business.review_count > 100 AND category.business_id = business.business_id AND category.category_name = 'Pet Groomers'
### 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 Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types (...
SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details ORDER BY COUNT(lot_details)
### 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 paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'Caltech' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid
### 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 paper.paperid FROM paper, venue WHERE paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL'
### Instruction: CREATE TABLE table_test_3 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "severe_hemodynamic_instability" bool, "consent" bool, "hemoglobin_a1c_hba1c" float, "metallic_implants" bool, "allergy_to_aspirin" bool, "creatinine_clearance_cl" float, "post_...
SELECT * FROM table_test_3 WHERE contraindication_for_nmr = 1 OR (creatinine_clearance_cl < 30 OR metallic_implants = 1 OR claustrophobia = 1)
### Instruction: CREATE TABLE airport_aircraft ( id number, airport_id number, aircraft_id number ) CREATE TABLE pilot ( pilot_id number, name text, age number ) CREATE TABLE match ( round number, location text, country text, date text, fastest_qualifying text, winning_...
SELECT t1.name, t1.age FROM pilot AS t1 JOIN match AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE department ( dno number, division text, dname text, room text, building text, dphone number ) CREATE TABLE member_of ( facid number, dno number, appt_type text ) CREATE TABLE course ( cid text, cname text, credits number, instructor num...
SELECT cname FROM course WHERE credits = 3 UNION SELECT cname FROM course WHERE credits = 1 AND hours = 4
### Instruction: CREATE TABLE table_name_63 ( black__both_hispanic_and_non_hispanic_ VARCHAR, municipality__2010_ VARCHAR, amerindian__both_hispanic_and_non_hispanic_ VARCHAR, white__both_hispanic_and_non_hispanic_ VARCHAR, n_asia__both_hispanic_and_non_hispanic_ VARCHAR ) -- Using valid SQLite, a...
SELECT black__both_hispanic_and_non_hispanic_ FROM table_name_63 WHERE white__both_hispanic_and_non_hispanic_ < 80.6 AND n_asia__both_hispanic_and_non_hispanic_ = 0.1 AND amerindian__both_hispanic_and_non_hispanic_ < 0.6000000000000001 AND municipality__2010_ = "vega baja"
### Instruction: CREATE TABLE order_items ( order_id number, product_id number, order_quantity text ) CREATE TABLE customer_contact_channels ( customer_id number, channel_code text, active_from_date time, active_to_date time, contact_number text ) CREATE TABLE addresses ( address_i...
SELECT state_province_county, country FROM addresses WHERE zip_postcode LIKE "4%"
### Instruction: 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 TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CRE...
SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction DESC
### Instruction: CREATE TABLE table_66548 ( "Manufacturer" text, "Transmission" text, "Engine Capacity" real, "Fuel Type" text, "L/100km Urban (Cold)" real, "L/100km Extra-Urban" real, "L/100km Combined" real, "mpg-UK Urban (Cold)" real, "mpg-UK Extra-Urban" real, "mpg-UK Combine...
SELECT MIN("mpg-UK Combined") FROM table_66548 WHERE "mpg-UK Urban (Cold)" = '25.4' AND "L/100km Extra-Urban" < '6.9' AND "L/100km Urban (Cold)" > '11.1'
### Instruction: CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) 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 va...
SELECT SUM(business.review_count) FROM business, neighborhood WHERE neighborhood.business_id = business.business_id AND neighborhood.neighborhood_name = 'South Summerlin'
### Instruction: CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction...
SELECT date_of_transaction, AVG(share_count) FROM Transactions ORDER BY AVG(share_count)
### Instruction: CREATE TABLE student_tests_taken ( registration_id number, date_test_taken time, test_result text ) CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time ) CREATE TABLE stude...
SELECT login_name FROM students WHERE family_name = "Ward"
### Instruction: CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Lots ( lot_...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE"
### Instruction: CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes ...
SELECT COUNT(DISTINCT (business.name)) FROM business, category WHERE business.city = 'Madison' AND category.business_id = business.business_id AND category.category_name = 'escape games'
### Instruction: CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperke...
SELECT DISTINCT paper.paperid FROM paper, venue WHERE paper.year = 2013 AND venue.venueid = paper.venueid AND venue.venuename = 'acl'
### Instruction: CREATE TABLE locations ( location_id number, street_address text, postal_code text, city text, state_province text, country_id text ) CREATE TABLE jobs ( job_id text, job_title text, min_salary number, max_salary number ) CREATE TABLE countries ( country_id...
SELECT employee_id, MAX(end_date) FROM job_history GROUP BY employee_id
### 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 paper.venueid FROM author, paper, writes WHERE author.authorname = 'Noah A. Smith' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE writes ( paperid int, authorid int...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'subhasis chaudhuri' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE table_dev_31 ( "id" int, "gender" string, "pre_dm" bool, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "diabetic" string, "fasting_blood_glucose_fbg" float, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "fast...
SELECT * FROM table_dev_31 WHERE renal_disease = 1 OR (estimated_glomerular_filtration_rate_egfr < 60 OR creatinine_clearance_cl > 2)
### Instruction: CREATE TABLE user ( uid int, user_id varchar, name varchar ) CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE business ( bid int, bus...
SELECT review.text FROM business, review WHERE business.name = 'Kabob Palace' AND review.business_id = business.business_id AND review.year = 2014
### Instruction: CREATE TABLE employees ( employee_id number, first_name text, last_name text, email text, phone_number text, hire_date time, job_id text, salary number, commission_pct number, manager_id number, department_id number ) CREATE TABLE countries ( country_id ...
SELECT * FROM employees WHERE hire_date > '1987-09-07'
### Instruction: CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varc...
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'daniela witten' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperfield ( fieldid int, ...
SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.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 paper.paperid FROM paper, venue WHERE paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename = 'sigir'
### Instruction: CREATE TABLE policies ( policy_id number, customer_id number, policy_type_code text, start_date time, end_date time ) CREATE TABLE claims_processing_stages ( claim_stage_id number, next_claim_stage_id number, claim_status_name text, claim_status_description text ) ...
SELECT customer_details FROM customers ORDER BY customer_details
### Instruction: CREATE TABLE Has_amenity ( dormid INTEGER, amenid 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 TABLE Lives_in ( stui...
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
### 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 paper.paperid FROM paper, venue WHERE paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'EMNLP'
### Instruction: CREATE TABLE characteristics ( characteristic_id number, characteristic_type_code text, characteristic_data_type text, characteristic_name text, other_characteristic_details text ) CREATE TABLE product_characteristics ( product_id number, characteristic_id number, produ...
SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "warm"
### 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 dataset, paper, paperdataset WHERE dataset.datasetname = 'NELL' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid
### Instruction: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE has_amenity ( dormid number, ame...
SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3...
### 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 order_items ( order_id number, product_id number, order_quantity text ) CREATE TABLE customer_orders ( ord...
SELECT AVG(active_to_date - active_from_date) FROM customer_contact_channels
### Instruction: CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_...
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, personal_name text, middle_name text, family_name text ) CREATE TABLE student_tests_taken ( registration_id number, date_test_taken t...
SELECT address_line_1 FROM course_authors_and_tutors
### Instruction: CREATE TABLE table_46411 ( "C/W 15+" real, "Oblast\\Age" text, "15 to 17" real, "18 to 19" text, "20 to 24" real, "25 to 29" real, "30 to 34" real, "35 to 39" real, "40 to 44" real, "45 to 49" real, "50 to 54" real, "55 to 59" real, "60 to 64" real, ...
SELECT AVG("60 to 64") FROM table_46411 WHERE "50 to 54" < '2,054' AND "35 to 39" > '1,704' AND "30 to 34" < '1,381' AND "Oblast\\Age" = 'evenkia'
### Instruction: CREATE TABLE staff ( staff_id number, gender text, first_name text, last_name text, email_address text, phone_number text ) CREATE TABLE complaints ( complaint_id number, product_id number, customer_id number, complaint_outcome_code text, complaint_status_co...
SELECT address_line_1, address_line_2 FROM customers WHERE email_address = "vbogisich@example.org"
### Instruction: CREATE TABLE match ( Round real, Location text, Country text, Date text, Fastest_Qualifying text, Winning_Pilot text, Winning_Aircraft text ) CREATE TABLE airport_aircraft ( ID int, Airport_ID int, Aircraft_ID int ) CREATE TABLE pilot ( Pilot_Id int(11), ...
SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description ORDER BY COUNT(Description)
### Instruction: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE dorm_amenity ( amenid number, am...
SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.am...
### 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 writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'NIPS' AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE table_dev_21 ( "id" int, "gender" string, "leukopenia" int, "dialysis" bool, "hemoglobin_a1c_hba1c" float, "cd4_count" int, "platelets" int, "renal_disease" bool, "fasting_triglycerides" int, "hyperlipidemia" bool, "lymphopenia" int, "hba1c" ...
SELECT * FROM table_dev_21 WHERE renal_disease = 1 OR (serum_creatinine >= 1.4 AND gender = 'female') OR (serum_creatinine >= 1.5 AND gender = 'male') OR dialysis = 1
### Instruction: CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, personal_name text, middle_name text, family_name text ) CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE...
SELECT course_description FROM courses WHERE course_name = "database"
### Instruction: CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, ...
SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name ORDER BY COUNT(T4.Name) DESC
### Instruction: CREATE TABLE table_dev_56 ( "id" int, "anemia" bool, "gender" string, "white_blood_cell_count_wbc" int, "hemoglobinopathy" bool, "major_hematological_conditions" bool, "laboratory_abnormality" bool, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "hematocrit_...
SELECT * FROM table_dev_56 WHERE major_hematological_conditions = 1 OR laboratory_abnormality = 1 OR (hemoglobin_a1c_hba1c < 10 OR white_blood_cell_count_wbc < 3000 OR platelet_count < 100000)
### Instruction: CREATE TABLE employees ( employee_id number, first_name text, last_name text, email text, phone_number text, hire_date time, job_id text, salary number, commission_pct number, manager_id number, department_id number ) CREATE TABLE jobs ( job_id text, ...
SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen'
### Instruction: CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( ...
SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'NELL' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid
### Instruction: CREATE TABLE employees ( employee_id number, first_name text, last_name text, email text, phone_number text, hire_date time, job_id text, salary number, commission_pct number, manager_id number, department_id number ) CREATE TABLE departments ( departmen...
SELECT job_title FROM jobs WHERE min_salary > 9000
### Instruction: CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(2...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions
### Instruction: CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, bathroom_count number, bedroom_count number, room_count text ) CREATE TABLE guests ( guest_...
SELECT guest_first_name, guest_last_name FROM guests
### Instruction: CREATE TABLE courses ( course_id number, author_id number, subject_id number, course_name text, course_description text ) CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE student_course_enrolment ( registration_id number, student_id numbe...
SELECT COUNT(course_id) FROM student_course_enrolment
### Instruction: CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) CREATE TABLE characteristics ( characterist...
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2
### Instruction: CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE ...
SELECT DISTINCT paper.paperid FROM paper, venue WHERE paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'acm dev'
### Instruction: CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ) CREATE TABLE order_items ( order_id number, product_id number, order_quantity text ) CREATE TABLE customer_addresses ( customer_id number, ...
SELECT customer_name FROM customers WHERE payment_method = "Cash"
### Instruction: CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE review ...
SELECT business.name FROM business, category WHERE business.state = 'Pennsylvania' AND category.business_id = business.business_id AND category.category_name = 'restaurant'
### Instruction: CREATE TABLE table_train_144 ( "id" int, "retinal_dystrophy" bool, "mini_mental_state_examination_mmse" int, "memory_box" float, "body_weight" float, "neutrophil_count" int, "moca_score" int, "severe_dementia" bool, "dementia" bool, "macular_degeneration" bool, ...
SELECT * FROM table_train_144 WHERE body_mass_index_bmi >= 17.5 AND body_mass_index_bmi <= 30.5 AND body_weight > 50
### Instruction: CREATE TABLE claims_processing_stages ( claim_stage_id number, next_claim_stage_id number, claim_status_name text, claim_status_description text ) CREATE TABLE policies ( policy_id number, customer_id number, policy_type_code text, start_date time, end_date time ) ...
SELECT COUNT(*) FROM claims_processing_stages
### Instruction: CREATE TABLE table_204_0 ( id number, "poll source" text, "date(s)\nadministered" text, "sample\nsize" number, "margin of\nerror" text, "ed burke" text, "roland burris" text, "gery chico" text, "bill daley" text, "tom dart" text, "danny k. davis" text, "m...
SELECT "poll source" FROM table_204_0 WHERE "poll source" IN ('chicago sun-times', 'chicago tribune') ORDER BY "sample\nsize" DESC LIMIT 1
### Instruction: 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 Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions
### Instruction: CREATE TABLE complaints ( complaint_id number, product_id number, customer_id number, complaint_outcome_code text, complaint_status_code text, complaint_type_code text, date_complaint_raised time, date_complaint_closed time, staff_id number ) CREATE TABLE staff ( ...
SELECT complaint_status_code, COUNT(*) FROM complaints WHERE complaint_type_code = "Product Failure" GROUP BY complaint_status_code
### Instruction: CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE category ( id int, business_id var...
SELECT business.name FROM business, category WHERE category.business_id = business.business_id GROUP BY business.name ORDER BY COUNT(DISTINCT (category.category_name)) DESC LIMIT 1
### Instruction: CREATE TABLE departments ( department_id number, department_name text, manager_id number, location_id number ) 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...
SELECT salary, manager_id FROM employees WHERE manager_id <> "null"
### Instruction: CREATE TABLE minor_in ( stuid number, dno number ) CREATE TABLE enrolled_in ( stuid number, cid text, grade text ) CREATE TABLE member_of ( facid number, dno number, appt_type text ) CREATE TABLE course ( cid text, cname text, credits number, instructo...
SELECT room FROM faculty WHERE rank = "Professor" AND building = "NEB"
### 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 order_items ( order_id number, product_id number, order_quantity text ) CREATE TABLE customer_addresses ( ...
SELECT country FROM addresses GROUP BY country HAVING COUNT(address_id) > 4
### 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 apt_number FROM apartments ORDER BY room_count
### Instruction: CREATE TABLE claims ( claim_id number, policy_id number, date_claim_made time, date_claim_settled time, amount_claimed number, amount_settled number ) CREATE TABLE settlements ( settlement_id number, claim_id number, date_claim_made time, date_claim_settled time...
SELECT COUNT(*), T1.claim_id FROM claims AS T1 JOIN settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.date_claim_settled DESC LIMIT 1
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE venue ( venue...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'fahad pervaiz' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE ...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'Christopher D. Manning' AND writes.authorid = author.authorid
### Instruction: CREATE TABLE problem_category_codes ( problem_category_code text, problem_category_description text ) CREATE TABLE problem_status_codes ( problem_status_code text, problem_status_description text ) CREATE TABLE product ( product_id number, product_name text, product_detail...
SELECT DISTINCT product_name FROM product ORDER BY product_name
### Instruction: CREATE TABLE shipment_items ( shipment_id number, order_item_id number ) CREATE TABLE orders ( order_id number, customer_id number, order_status text, date_order_placed time, order_details text ) CREATE TABLE products ( product_id number, product_name text, pro...
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
### 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 airport_aircraft ( ID int, Airport_ID int, Aircraft_ID int ) CREATE TA...
SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description ORDER BY COUNT(Description) DESC
### Instruction: CREATE TABLE table_26778 ( "Guberniya *" text, "Total Population" real, "Belarusian (\u0411\u0463\u043b\u043e\u0440\u0443\u0441\u043a\u0456\u0439)" real, "Russian (\u0412\u0463\u043b\u0438\u043a\u043e\u0440\u0443\u0441\u043a\u0456\u0439)" real, "Polish (\u041f\u043e\u043b\u044c\u044...
SELECT "Polish (\u041f\u043e\u043b\u044c\u0441\u043a\u0456\u0439)" FROM table_26778 WHERE "Guberniya *" = 'Vitebsk'
### Instruction: CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperkeyphrase ( paperi...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'lorenzo bruzzone' AND writes.authorid = author.authorid
### Instruction: CREATE TABLE ref_colors ( color_code text, color_description text ) CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_selling_price text, product_description text, other_...
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
### Instruction: CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE writes ( pap...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'james fogarty' AND writes.authorid = author.authorid
### Instruction: CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) 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 VARCH...
SELECT investor_id, AVG(amount_of_transaction) FROM Transactions GROUP BY investor_id
### Instruction: CREATE TABLE category ( id int, business_id varchar, category_name varchar ) 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, ...
SELECT business.name FROM business, category WHERE business.city = 'Los Angeles' AND category.business_id = business.business_id AND category.category_name = 'bakeries'
### Instruction: CREATE TABLE catalogs ( catalog_id number, catalog_name text, catalog_publisher text, date_of_publication time, date_of_latest_revision time ) CREATE TABLE catalog_contents ( catalog_entry_id number, catalog_level_number number, parent_entry_id number, previous_entr...
SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%"
### Instruction: CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE venue ( venueid int, venuename varch...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'Mirella Lapata' AND writes.authorid = author.authorid
### Instruction: CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( cit...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'ameet soni' AND writes.authorid = author.authorid
### Instruction: CREATE TABLE table_43661 ( "Bank" text, "Score (Iran)" real, "Score (Global)" real, "Banking Power/Capital Base ($ Million)" real, "Banking Power/Capital Base (% Change)" text, "Total Assets ($ Million)" real, "Total Assets (Score)" real, "Total Assets (% Change)" text, ...
SELECT MAX("Credibility/Capital to Assets Ratio (Score)") FROM table_43661 WHERE "Credibility/Capital to Assets Ratio (%)" > '4.66' AND "Banking Power/Capital Base ($ Million)" < '2,550'
### Instruction: CREATE TABLE catalog_structure ( catalog_level_number number, catalog_id number, catalog_level_name text ) CREATE TABLE catalog_contents ( catalog_entry_id number, catalog_level_number number, parent_entry_id number, previous_entry_id number, next_entry_id number, c...
SELECT AVG(price_in_euros), MIN(price_in_euros) FROM catalog_contents
### Instruction: CREATE TABLE catalog_structure ( catalog_level_number number, catalog_id number, catalog_level_name text ) CREATE TABLE catalogs ( catalog_id number, catalog_name text, catalog_publisher text, date_of_publication time, date_of_latest_revision time ) CREATE TABLE catalo...
SELECT attribute_data_type FROM attribute_definitions GROUP BY attribute_data_type HAVING COUNT(*) > 3
### 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
### Instruction: CREATE TABLE pilot ( Pilot_Id int(11), Name varchar(50), Age int(11) ) CREATE TABLE airport_aircraft ( ID int, Airport_ID int, Aircraft_ID int ) CREATE TABLE aircraft ( Aircraft_ID int(11), Aircraft varchar(50), Description varchar(50), Max_Gross_Weight varchar...
SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description ORDER BY Description DESC
### 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 writes.paperid) FROM author, writes WHERE author.authorname = 'jeff dean' AND writes.authorid = author.authorid
### Instruction: CREATE TABLE catalogs ( catalog_id number, catalog_name text, catalog_publisher text, date_of_publication time, date_of_latest_revision time ) CREATE TABLE catalog_contents ( catalog_entry_id number, catalog_level_number number, parent_entry_id number, previous_entr...
SELECT catalog_entry_name FROM catalog_contents WHERE length < 3 OR width > 5
### 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 Description, COUNT(Description) FROM aircraft GROUP BY Description ORDER BY COUNT(Description)
### 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 COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'dominik moritz' AND writes.authorid = author.authorid
### Instruction: CREATE TABLE table_test_2 ( "id" int, "loss_of_consciousness" bool, "gender" string, "bleeding" int, "systolic_blood_pressure_sbp" int, "stroke" bool, "renal_disease" bool, "hemorrhagic_diathesis" bool, "transient_ischemic_attack" bool, "creatinine_clearance_cl" ...
SELECT * FROM table_test_2 WHERE bleeding = 1 OR hemorrhagic_diathesis = 1