instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### 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_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa'
### 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 low_ejection_fraction < 40 OR heart_disease = 1
### 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_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY COUNT(*)
### Instruction: CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperi...
SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid
### Instruction: CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, ...
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(paper.paperid) DESC
### Instruction: CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text, other_details text ) CREATE TABLE ref_locations ( location_code text, location_name text, location_description text ) CREATE T...
SELECT DISTINCT location_code FROM document_locations
### Instruction: CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int...
SELECT DISTINCT author.authorname, COUNT(writes.paperid) FROM author, writes WHERE author.authorname IN ('Geoffrey E. Hinton', 'Yann Lecun') AND writes.authorid = author.authorid GROUP BY author.authorname ORDER BY COUNT(writes.paperid) DESC
### Instruction: CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ...
SELECT COUNT(DISTINCT (keyword)) FROM keyword
### Instruction: 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) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(2...
SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3
### Instruction: CREATE TABLE salary ( year number, team_id text, league_id text, player_id text, salary number ) CREATE TABLE player ( player_id text, birth_year text, birth_month text, birth_day text, birth_country text, birth_state text, birth_city text, death_yea...
SELECT DISTINCT yearid FROM hall_of_fame WHERE needed_note <> ""
### Instruction: CREATE TABLE table_10011 ( "1997\u201398" text, "1998\u201399" text, "1999\u201300" text, "2000\u201301" text, "2001\u201302" text, "2002\u201303" text, "2003\u201304" text, "2004\u201305" text, "2005\u201306" text, "2006\u201307" text, "2007\u201308" text, ...
SELECT "2001\u201302" FROM table_10011 WHERE "2012\u201313" = 'yago'
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE cite ( citingpaperid...
SELECT DISTINCT paper.year FROM author, paper, venue, writes WHERE author.authorname = 'Michael Stonebraker' AND venue.venueid = paper.venueid AND venue.venuename = 'VLDB' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year
### Instruction: CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), ...
SELECT Document_Name, COUNT(Document_Name) FROM Documents GROUP BY Document_Name ORDER BY Document_Name DESC
### Instruction: CREATE TABLE table_test_21 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "tachycardia" int, "body_weight" float, "renal_disease" bool, "anaemia" bool, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "cardiogenic...
SELECT * FROM table_test_21 WHERE renal_disease = 1 OR renal_disease = 1 OR serum_creatinine > 2 OR creatinine_clearance_cl < 30
### 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 COUNT(paper.paperid), paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.year ORDER BY paper.year DESC
### 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 T1.first_name, T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance'
### Instruction: CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID...
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code
### 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 Customers ( customer_id INTEGER, customer_first...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
### Instruction: CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE dataset ( dataseti...
SELECT DISTINCT paperkeyphrase.paperid FROM keyphrase, paperkeyphrase WHERE keyphrase.keyphrasename IN ('Multiuser Receiver', 'Decision Feedback') GROUP BY paperkeyphrase.paperid HAVING COUNT(DISTINCT keyphrase.keyphraseid) = 1
### 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 dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'knn' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid
### Instruction: CREATE TABLE enrolled_in ( stuid number, cid text, grade text ) 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, ...
SELECT T2.dname, T2.room FROM course AS T1 JOIN department AS T2 ON T1.dno = T2.dno WHERE T1.cname = "INTRODUCTION TO COMPUTER SCIENCE"
### Instruction: CREATE TABLE Statements ( Statement_ID INTEGER, Statement_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),...
SELECT COUNT(*), Project_ID FROM Documents WHERE Document_Type_Code = "BK" GROUP BY Project_ID
### 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 paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'question answering' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016
### Instruction: CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE...
SELECT DISTINCT COUNT(DISTINCT paper.paperid), writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(DISTINCT paper.paperid) DESC
### Instruction: CREATE TABLE table_dev_29 ( "id" int, "gender" string, "white_blood_cell_count_wbc" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "creatinine_clearance_cl" float, "post_load_glucose" int, "platelet_count" float, "fast...
SELECT * FROM table_dev_29 WHERE (systolic_blood_pressure_sbp < 90 OR systolic_blood_pressure_sbp > 150) AND (diastolic_blood_pressure_dbp > 100 OR diastolic_blood_pressure_dbp < 50)
### Instruction: 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 number ) CREATE TABLE employees ( employee_id number, first_nam...
SELECT first_name, last_name, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)
### Instruction: CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text, other_details text ) CREATE TABLE ref_calendar ( calendar_date time, day_number number ) CREATE TABLE document_locations ( doc...
SELECT COUNT(*) FROM ref_locations
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE cite ( citingpaperid...
SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'david blei' AND venue.venueid = paper.venueid AND venue.venuename = 'nips' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_P...
SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa'
### Instruction: CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int,...
SELECT DISTINCT paperkeyphrase.paperid FROM keyphrase, paperkeyphrase WHERE keyphrase.keyphrasename IN ('Multiuser Receiver', 'Decision Feedback') GROUP BY paperkeyphrase.paperid HAVING COUNT(DISTINCT keyphrase.keyphraseid) = 1
### Instruction: CREATE TABLE match ( Round real, Location text, Country text, Date text, Fastest_Qualifying text, Winning_Pilot text, Winning_Aircraft text ) CREATE TABLE aircraft ( Aircraft_ID int(11), Aircraft varchar(50), Description varchar(50), Max_Gross_Weight varchar...
SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*)
### Instruction: CREATE TABLE attribute_definitions ( attribute_id number, attribute_name text, attribute_data_type text ) CREATE TABLE catalogs ( catalog_id number, catalog_name text, catalog_publisher text, date_of_publication time, date_of_latest_revision time ) CREATE TABLE catalog...
SELECT t1.attribute_name, t1.attribute_id FROM attribute_definitions AS t1 JOIN catalog_contents_additional_attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0
### 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 paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'James Fogarty' AND venue.venueid = paper.venueid AND venue.venuename = 'ubicomp' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### 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 Statements ( Statement_ID INTEGER, Statement_Det...
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types GROUP BY Document_Type_Description
### Instruction: CREATE TABLE table_dev_36 ( "id" int, "gender" string, "prediabetes" bool, "leukopenia" int, "hemoglobin_a1c_hba1c" float, "cd4_count" int, "platelets" int, "hematocrit_hct" float, "fasting_triglycerides" int, "hyperlipidemia" bool, "lymphopenia" int, "fa...
SELECT * FROM table_dev_36 WHERE (fasting_glucose >= 100 AND fasting_glucose <= 125) OR (hemoglobin_a1c_hba1c >= 5.7 AND hemoglobin_a1c_hba1c <= 6.4) OR (prediabetes = 1 OR impaired_fasting_glucose = 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 writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename IN ('ICML', 'ACL') AND writes.paperid = paper.paperid GROUP BY writes.authorid HAVING COUNT(DISTINCT venue.venueid) = 2
### Instruction: CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int, dataset...
SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'Daphne Koller' AND venue.venueid = paper.venueid AND venue.venuename = 'ICML' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE table_test_22 ( "id" int, "ejection_fraction_ef" int, "pregnancy_or_lactation" bool, "child_pugh_class" string, "hbv" bool, "systolic_blood_pressure_sbp" int, "active_infection" bool, "leukocyte_count" int, "hiv_infection" bool, "left_ventricular_dys...
SELECT * FROM table_test_22 WHERE active_infection = 1 OR active_infection = 1 AND (hiv_infection = 1 OR hbv = 1 OR hcv = 1)
### 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 paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'Yejin Kim' AND venue.venueid = paper.venueid AND venue.venuename = 'Immune network' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### 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 courses ( course_id number, author_id number, subject_id number, course_name text, course_descript...
SELECT date_of_latest_logon FROM students WHERE family_name = "Jaskolski" OR family_name = "Langosh"
### Instruction: CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paperkeyphrase ( ...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year > 2010
### Instruction: CREATE TABLE table_14147 ( "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 AVG("L/100km Urban (Cold)") FROM table_14147 WHERE "Engine Capacity" > '1910' AND "mpg-US Urban" < '25.3' AND "mpg-UK Combined" > '27.2' AND "mpg-UK Urban (Cold)" = '22.4'
### Instruction: CREATE TABLE table_train_214 ( "id" int, "gender" string, "lead_ecg" bool, "systolic_blood_pressure_sbp" int, "qt_interval" bool, "urine_dipstick_protein" int, "stroke" bool, "transient_ischemic_attack" bool, "qtc" int, "long_qt_syndrome" bool, "cardiovascula...
SELECT * FROM table_train_214 WHERE lead_ecg = 1 OR (qt_interval = 1 OR (gender = 'male' AND qtc > 450) OR (gender = 'female' AND qtc > 470))
### Instruction: CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paperkeyphrase ( ...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'character recognition' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year < 2010
### 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 = 'image understanding' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year DESC
### 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 COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'trevor perrier' AND venue.venueid = paper.venueid AND venue.venuename = 'chi' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) ...
SELECT DISTINCT COUNT(DISTINCT paper.paperid), writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'chi' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(DISTINCT paper.paperid) DESC
### Instruction: CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction...
SELECT account_id, COUNT(*) FROM Financial_Transactions GROUP BY account_id
### 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 Customers_Cards ( c...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
### 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 Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE" ORDER BY COUNT(date_of_transaction)
### 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 author.authorname FROM author, keyphrase, paperkeyphrase, writes WHERE keyphrase.keyphrasename LIKE 'deep learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid
### Instruction: CREATE TABLE table_test_19 ( "id" int, "gender" string, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "acute_infectious" bool, "hypertensive_retinopathy" bool, "leukocyte_count" int, "severe_uncontrolled_hypertension" bool, "chroni...
SELECT * FROM table_test_19 WHERE leukocyte_count < 3000 OR platelet_count < 100000
### Instruction: CREATE TABLE ref_colors ( color_code text, color_description text ) CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) CREATE TABLE characteristics ( characteristic_id number, characteristic_type_code...
SELECT COUNT(*) 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 JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "slow"
### 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 customer_addresses ( customer_id number, address_id number, date_address_from time...
SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE match ( round number, location text, country text, date text, fastest_qualifying text, winning_pilot text, winning_aircraft text ) CREATE TABLE pilot ( pilot_id number, name text, age number ) CREATE TABLE airport ( airport_id number, airpo...
SELECT T1.aircraft, T1.description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN airport AS T3 ON T2.airport_id = T3.airport_id WHERE T3.total_passengers > 10000000
### 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 ORDER BY Aircraft
### Instruction: CREATE TABLE domain ( did int, name varchar ) CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE journal ( homepage varchar, jid int, name varchar ) CREATE TABLE writes ( aid in...
SELECT name FROM organization
### 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 Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY Aircraft
### Instruction: CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text lo...
SELECT COUNT(DISTINCT (user.name)) FROM business, review, user WHERE business.name = 'Bistro Di Napoli' AND review.business_id = business.business_id AND review.year = 2015 AND user.user_id = review.user_id
### 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 author.authorname FROM author, keyphrase, paperkeyphrase, writes WHERE keyphrase.keyphrasename LIKE 'Blink' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid
### Instruction: CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid i...
SELECT DISTINCT author.authorname FROM author, keyphrase, paperkeyphrase, writes WHERE keyphrase.keyphrasename LIKE 'query expansion' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid
### Instruction: CREATE TABLE regions ( region_id number, region_name text ) CREATE TABLE jobs ( job_id text, job_title text, min_salary number, max_salary number ) CREATE TABLE locations ( location_id number, street_address text, postal_code text, city text, state_province...
SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%')
### 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 active_ocular_disease = 1 OR (active_infection = 1 OR glaucoma = 1 OR seasonal_allergy = 1 OR dry_eye_symptoms = 1 OR retinal_nerve_disease = 1 OR optic_nerve_disease = 1)
### Instruction: CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from ...
SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id
### Instruction: CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE user ( uid int, user_id varchar...
SELECT SUM(tip.likes) FROM business, tip, user WHERE business.name = 'Cafe Zinho' AND tip.business_id = business.business_id AND user.name = 'Niloofar' AND user.user_id = tip.user_id
### 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, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163)
### 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 view_unit_status ( apt_id number, apt_booking_id num...
SELECT apt_type_code, COUNT(*) FROM apartments GROUP BY apt_type_code ORDER BY COUNT(*)
### Instruction: CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid i...
SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'fahad pervaiz' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, tie text, notes text ) CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots text, needed text, votes text, inducted text, category...
SELECT salary FROM salary WHERE league_id = "AL"
### Instruction: CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( ...
SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'deep learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### Instruction: CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE...
SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year DESC
### Instruction: CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) ...
SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year 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 view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartment_facilitie...
SELECT apt_type_code FROM apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE council_tax ( council_tax_id number, cmi_cross_ref_id number ) CREATE TABLE electoral_register ( electoral_register_id number, cmi_cross_ref_id number ) CREATE TABLE parking_fines ( council_tax_id number, cmi_cross_ref_id number ) CREATE TABLE customer_master_ind...
SELECT T1.source_system_code, T1.master_customer_id, T2.council_tax_id FROM cmi_cross_references AS T1 JOIN parking_fines AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id
### 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 fasting_blood_glucose_fbg < 100
### 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 Accounts ( account_id INTEGER, customer_id INTE...
SELECT customer_id, card_number FROM Customers_Cards
### Instruction: CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE guests ( guest_id number, gender_code text, guest_first_name text, guest_last_name text, date_of_birth time ) CREATE TABLE apartment_bookings ( apt_booking_id number, apt_id number...
SELECT apt_type_code FROM apartments GROUP BY apt_type_code ORDER BY AVG(room_count) DESC LIMIT 3
### Instruction: CREATE TABLE countries ( country_id text, country_name text, region_id number ) CREATE TABLE departments ( department_id number, department_name text, manager_id number, location_id number ) CREATE TABLE jobs ( job_id text, job_title text, min_salary number, ...
SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara")
### Instruction: CREATE TABLE document_functional_areas ( document_code text, functional_area_code text ) CREATE TABLE roles ( role_code text, role_description text ) CREATE TABLE users ( user_id number, role_code text, user_name text, user_login text, password text ) CREATE TABLE...
SELECT user_name, password FROM users GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1
### 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 Accounts ( account_id INTEGER, customer_id INTE...
SELECT account_id, account_name FROM Accounts
### Instruction: CREATE TABLE customer_address_history ( customer_id number, address_id number, date_from time, date_to time ) CREATE TABLE customer_orders ( order_id number, customer_id number, order_date time, order_status_code text ) CREATE TABLE products ( product_id number, ...
SELECT customer_name, customer_phone, payment_method_code FROM customers ORDER BY customer_number DESC
### Instruction: CREATE TABLE documents ( document_id number, document_type_code text, project_id number, document_date time, document_name text, document_description text, other_details text ) CREATE TABLE statements ( statement_id number, statement_details text ) CREATE TABLE doc...
SELECT T1.document_date FROM documents AS T1 JOIN documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM documents AS T1 JOIN documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF'
### Instruction: 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 Has_amenity ( dormid INTEGER, amenid INTEGER ) 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 ORDER BY COUNT(Fname)
### Instruction: CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperkeyphrase ( paperid ...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Temporal Correlation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### 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 paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'deep learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.year ORDER BY paper.year
### Instruction: CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) 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 ...
SELECT apt_type_code, MAX(room_count), MIN(room_count) FROM apartments GROUP BY apt_type_code
### Instruction: CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numcitin...
SELECT DISTINCT COUNT(1), paper.venueid FROM author, paper, writes WHERE author.authorname = 'Noah A. Smith' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.venueid ORDER BY COUNT(1) DESC
### Instruction: CREATE TABLE products ( product_id number, parent_product_id number, product_category_code text, date_product_first_available time, date_product_discontinued time, product_name text, product_description text, product_price number ) CREATE TABLE complaints ( complain...
SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY COUNT(*) LIMIT 1
### Instruction: CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperi...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic image segmentation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### 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 Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Pay...
SELECT Payment_Method_Code, AVG(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code
### 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 Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code
### 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 paperdataset.datasetid FROM author, paper, paperdataset, writes WHERE author.authorname = 'jitendra malik' AND paper.paperid = paperdataset.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE table_train_143 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "agitation" bool, "npi" int, "aggression_domain" bool, "delusions_hallucinations" bool, "pulse_rate" int, "fridericia_corrected_qt_interval_qtcf" int, "diastolic_blood_pr...
SELECT * FROM table_train_143 WHERE (npi >= 4 AND (delusions = 1 OR hallucinations = 1)) OR (npi >= 6 AND psychosis_subscale = 1 AND delusions_hallucinations = 1) OR (npi >= 4 AND agitation = 1 OR aggression_domain = 1)
### 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 departments ( department_id number, department_name text, manager_id numb...
SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id
### 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 Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements
### 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 customer_id, account_name FROM Accounts
### Instruction: 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) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100
### 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 Accounts ( account_id INTEGER, customer_id INTE...
SELECT account_id, account_name FROM Accounts
### Instruction: CREATE TABLE products ( product_id number, parent_product_id number, product_category_code text, date_product_first_available time, date_product_discontinued time, product_name text, product_description text, product_price number ) CREATE TABLE complaints ( complain...
SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) LIMIT 1
### Instruction: CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Descrip...
SELECT Document_Name, COUNT(Document_Name) FROM Documents GROUP BY Document_Name