instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### Instruction: CREATE TABLE table_train_142 ( "id" int, "allergy_to_monoclonal_antibodies" bool, "allergic_reactions" bool, "allergy_to_methylprednisolone" bool, "mini_mental_state_examination_mmse" int, "depressed_mood" bool, "urea_cycle_disorder" bool, "clinical_contraindication_use_...
SELECT * FROM table_train_142 WHERE body_mass_index_bmi < 38 AND body_weight > 48
### Instruction: CREATE TABLE addresses ( address_id number, line_1 text, line_2 text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE candidate_assessments ( candidate_id number, qualification text, assessment_date time, asessment_outco...
SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance
### Instruction: CREATE TABLE people_addresses ( person_address_id number, person_id number, address_id number, date_from time, date_to time ) CREATE TABLE student_course_attendance ( student_id number, course_id number, date_of_attendance time ) CREATE TABLE candidate_assessments ( ...
SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = "Pass"
### Instruction: CREATE TABLE customers ( customer_id number, customer_name text ) CREATE TABLE claims ( claim_id number, fnol_id number, effective_date time ) CREATE TABLE available_policies ( policy_id number, policy_type_code text, customer_phone text ) CREATE TABLE services ( ...
SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_...
### Instruction: CREATE TABLE locations ( location_id number, street_address text, postal_code text, city text, state_province text, country_id text ) CREATE TABLE employees ( employee_id number, first_name text, last_name text, email text, phone_number text, hire_date t...
SELECT T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id
### Instruction: CREATE TABLE document_structures ( document_structure_code text, parent_document_structure_code text, document_structure_description text ) CREATE TABLE document_sections ( section_id number, document_code text, section_sequence number, section_code text, section_title ...
SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABL...
SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Li Dong' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authori...
### 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 severe_uncontrolled_hypertension = 1 OR systolic_blood_pressure_sbp >= 180 OR diastolic_blood_pressure_dbp >= 110 OR hypertensive_retinopathy = 1
### 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 keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'lasso' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'icml'
### Instruction: CREATE TABLE ref_calendar ( calendar_date time, day_number number ) CREATE TABLE ref_locations ( location_code text, location_name text, location_description text ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_descri...
SELECT employee_id FROM employees EXCEPT SELECT destruction_authorised_by_employee_id FROM documents_to_be_destroyed
### Instruction: CREATE TABLE order_items ( order_id number, product_id number, order_quantity text ) CREATE TABLE customer_addresses ( customer_id number, address_id number, date_address_from time, address_type text, date_address_to time ) CREATE TABLE customers ( customer_id numb...
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items)
### Instruction: CREATE TABLE table_203_54 ( id number, "selected\nlatin american\ncountries" text, "internl.\ntourism\narrivals\n2010\n(x 1000)" number, "internl.\ntourism\nreceipts.\n2010\n(usd\n(x1000)" number, "average\nreceipt\nper visitor\n2009\n(usd/turista)" number, "tourist\narrivals\np...
SELECT "selected\nlatin american\ncountries" FROM table_203_54 ORDER BY "receipts\nper\ncapita\n2005\nusd" DESC LIMIT 1
### 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 Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Sales (...
SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY COUNT(purchase_details)
### Instruction: CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE documents_to_be_destroyed ( document_id number, destruction_authorised_by_employee_id number, destroyed_by_employee_id number, planned_destructi...
SELECT location_code, date_in_location_from, date_in_locaton_to FROM document_locations
### 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 cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'behcet acikmese' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC
### Instruction: CREATE TABLE courses ( course_id text, course_name text, course_description text, other_details text ) CREATE TABLE candidate_assessments ( candidate_id number, qualification text, assessment_date time, asessment_outcome_code text ) CREATE TABLE addresses ( address...
SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = "Pass"
### Instruction: CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE user ( uid int, user_id varchar, name varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, lat...
SELECT COUNT(DISTINCT (user.name)) FROM business, category, review, user WHERE business.city = 'Dallas' AND business.name = 'Texas de Brazil' AND business.state = 'Texas' AND category.business_id = business.business_id AND category.category_name = 'restaurant' AND review.business_id = business.business_id AND user.user...
### Instruction: CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), ...
SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(card_type_code) DESC
### Instruction: CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) 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_...
SELECT Date_Payment_Made, COUNT(Date_Payment_Made) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY COUNT(Date_Payment_Made)
### Instruction: 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_year text, death_month text, death_day text, death_country text, death_state text, death_city text, ...
SELECT MIN(votes), yearid FROM hall_of_fame WHERE inducted = "Y" AND yearid >= 1871 GROUP BY yearid
### 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 tip ( tip_id int, business_i...
SELECT business.name FROM business, category AS CATEGORY_0, category AS CATEGORY_1 WHERE business.city = 'Pittsburgh' AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'Hospice' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'Pet'
### Instruction: CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE guests ( guest_id number, gender_code text, guest_first_name text, ...
SELECT T1.booking_start_date, T1.booking_start_date FROM apartment_bookings AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex"
### 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 sales_details, COUNT(sales_details) FROM Sales AS T1 JOIN Transactions AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 GROUP BY sales_details ORDER BY sales_details
### 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 Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(...
SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY purchase_details DESC
### 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 COUNT(1), WRITES_1.authorid FROM author, writes AS WRITES_0, writes AS WRITES_1 WHERE author.authorname = 'Richard Sutton' AND WRITES_0.authorid = author.authorid AND WRITES_1.paperid = WRITES_0.paperid GROUP BY WRITES_1.authorid ORDER BY COUNT(1) DESC
### Instruction: CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE dataset ( datasetid ...
SELECT DISTINCT paper.year FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'qiang ma' AND keyphrase.keyphrasename = 'MapReduce' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = pap...
### Instruction: CREATE TABLE order_items ( order_id number, product_id number, order_quantity text ) CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ) CREATE TABLE customers ( customer_id number, paymen...
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1
### Instruction: CREATE TABLE salary ( year number, team_id text, league_id text, player_id text, salary number ) CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots text, needed text, votes text, inducted text, category text, needed_...
SELECT birth_country FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY T1.birth_country ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE documents_to_be_destroyed ( document_id number, destruction_authorised_by_employee_id number, destroyed_by_employee_id number, planned_destruction_date time, actual_destruction_date time, other_details text ) CREATE TABLE ref_calendar ( calendar_date time, ...
SELECT COUNT(*) FROM all_documents WHERE document_type_code = "CV" OR document_type_code = "BK"
### Instruction: CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description V...
SELECT Statement_Details, COUNT(Statement_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY Statement_Details DESC
### 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 Transactions ( transaction_id INTEGER, investor_id INTEGER, transac...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Sales AS T1 JOIN Transactions AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000
### 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 Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Customer_Policies ( ...
SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY AVG(Amount_Payment)
### Instruction: CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Lots ( lot_id INTEGER, ...
SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY purchase_details
### 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 keyphrase.keyphrasename, paper.year FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'subhasis chaudhuri' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.pape...
### 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 keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2012 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL'
### Instruction: CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description V...
SELECT Statement_Details, COUNT(Statement_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY Statement_Details
### Instruction: CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, lesson_date time, lesson_time text, price number ) CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, fir...
SELECT COUNT(*) FROM lessons WHERE lesson_status_code = "Cancelled"
### Instruction: CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Oth...
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description
### Instruction: CREATE TABLE 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 paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'deep learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'icml'
### 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 Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Settlements ( Settl...
SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY Date_Payment_Made
### 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 tip ( tip_id int, business_i...
SELECT business.name FROM business, category AS CATEGORY_0, category AS CATEGORY_1 WHERE business.city = 'Los Angeles' AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'Italian' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'restaurant'
### 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 cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, paper, venue WHERE paper.paperid = cite.citedpaperid AND paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'EMNLP' GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC
### 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 t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t1.customer_name = "Maudie Kertzmann"
### 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 Transactions ( transaction_id INTEGER, investor_id INTEGER, transac...
SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details ORDER BY lot_details 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(1), dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'structured prediction' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid GROUP BY datas...
### 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 order_items ( order_id number, product_id number, order_quantity text ) CREATE TA...
SELECT channel_code, contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)
### 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, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY SUM(Amount_Payment)
### Instruction: CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description 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), Docu...
SELECT Document_Type_Name, COUNT(Document_Type_Name) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name
### 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 card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code
### Instruction: CREATE TABLE functional_areas ( functional_area_code text, parent_functional_area_code text, functional_area_description text ) CREATE TABLE document_functional_areas ( document_code text, functional_area_code text ) CREATE TABLE users ( user_id number, role_code text, ...
SELECT document_name FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) DESC LIMIT 3
### Instruction: CREATE TABLE invoices ( invoice_number number, invoice_date time, invoice_details text ) CREATE TABLE customers ( customer_id number, customer_name text, customer_details text ) CREATE TABLE shipment_items ( shipment_id number, order_item_id number ) CREATE TABLE orde...
SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= "1975-01-01" AND T1.date_order_placed <= "1976-01-01"
### Instruction: CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER,...
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description
### Instruction: CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar )...
SELECT DISTINCT paperkeyphrase.keyphraseid FROM author, paper, paperkeyphrase, venue, writes WHERE author.authorname = 'torlak' AND paper.paperid = paperkeyphrase.paperid AND venue.venueid = paper.venueid AND venue.venuename IN ('popl', 'pldi') AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar )...
SELECT DISTINCT (paper.paperid), COUNT(cite.citingpaperid) FROM cite, paper, venue WHERE paper.paperid = cite.citedpaperid AND paper.year = 2012 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' GROUP BY paper.paperid HAVING COUNT(cite.citingpaperid) > 7
### 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 card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code
### 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 paperkeyphrase.keyphraseid FROM author, paperkeyphrase, writes WHERE author.authorname IN ('Akihito Kotera', 'Masatsugu Kidode') AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid GROUP BY paperkeyphrase.keyphraseid HAVING COUNT(DISTINCT writes.authorid) = 2
### Instruction: CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE customer_policies ( policy_id number, customer_id number, policy_type_code text, start_date time, end_date time ) CREATE TABLE settlements ( settlement_id number, claim_id number, ...
SELECT T1.customer_details, T1.customer_id FROM customers AS T1 JOIN customer_policies AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 EXCEPT SELECT T1.customer_details, T1.customer_id FROM customers AS T1 JOIN customer_policies AS T2 ON T1.customer_id = T2.customer_id JOIN claims ...
### 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 card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code DESC
### Instruction: CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, ...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type DESC
### Instruction: CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transa...
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*)
### 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 T1.address_line_1, T2.author_id FROM course_authors_and_tutors AS T1 JOIN courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING COUNT(*) >= 2
### Instruction: CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots text, needed text, votes text, inducted text, category text, needed_note text ) CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, ...
SELECT AVG(T1.weight) FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY notes
### Instruction: CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( paper...
SELECT DISTINCT COUNT(DISTINCT cite.citingpaperid), writes.authorid FROM cite, paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'CVPR' AND writes.paperid = cite.citedpaperid AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(DISTINCT cite.citingpaperid) 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 transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY COUNT(*) 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 card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE writes ( p...
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'syntactic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY C...
### 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 Accounts ( account_...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type DESC
### 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_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name
### 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 T1.student_id, T2.login_name FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1
### 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 apartment_buildings...
SELECT T2.guest_first_name, T1.booking_start_date, T1.booking_start_date FROM apartment_bookings AS T1 JOIN guests AS T2 ON T1.guest_id = T2.guest_id
### Instruction: CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff tim...
SELECT vehicle_details FROM vehicles WHERE vehicle_id = 1
### 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 cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'ali farhadi' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC
### 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 T1.course_description, T1.course_name FROM courses AS T1 JOIN student_course_enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2
### Instruction: CREATE TABLE employees ( employee_id number, role_code text, employee_name text, gender_mfu text, date_of_birth time, other_details text ) CREATE TABLE documents_to_be_destroyed ( document_id number, destruction_authorised_by_employee_id number, destroyed_by_employe...
SELECT DISTINCT destruction_authorised_by_employee_id FROM documents_to_be_destroyed
### 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 documents_to_be_destroyed ( document_id number, destruction_authorised_by_employee_id number, ...
SELECT date_stored FROM all_documents WHERE document_name = "Marry CV"
### 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 course_authors_and_tutors ( author_id number, author_tutor_atb text...
SELECT T1.student_id, T2.middle_name FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2
### 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 apartments ( ap...
SELECT T1.booking_status_code FROM apartment_bookings AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_number = "Suite 634"
### Instruction: CREATE TABLE subjects ( subject_id number, subject_name text ) 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...
SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM courses AS T1 JOIN subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*)
### Instruction: CREATE TABLE domain_conference ( cid int, did int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE domain ( did int, name varchar ) CREATE TABLE public...
SELECT citation_num FROM publication WHERE title = 'Making database systems usable'
### Instruction: CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), ...
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types GROUP BY Document_Type_Description ORDER BY COUNT(Document_Type_Description) DESC
### 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.year, writes.paperid FROM author, paper, writes WHERE author.authorname IN ('Nigam H. Shah', 'Srinivasan Iyer') AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY writes.paperid HAVING COUNT(DISTINCT writes.authorid) = 2 ORDER BY paper.year DESC
### 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 card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code DESC
### 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 subje...
SELECT T1.student_id, T2.personal_name FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2
### 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 apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, ...
SELECT SUM(T2.room_count) FROM apartment_buildings AS T1 JOIN apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = "Columbus Square"
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( jou...
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citingpaperid) FROM cite, paper, venue WHERE paper.paperid = cite.citedpaperid AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'CVPR' GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citingpaperid) DESC
### 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_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name DESC
### Instruction: CREATE TABLE table_67537 ( "Country" text, "2012" real, "2011" real, "2010" real, "2009" real, "2008" real, "2007" real, "2006" real, "2005" real, "2004" real, "2003" real, "2002" real, "2001" real, "2000" real, "1999" real, "1998" real, ...
SELECT MIN("2012") FROM table_67537 WHERE "2004" > '0' AND "2008" > '1' AND "1994" = '8' AND "2005" < '11'
### Instruction: CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Statemen...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code
### Instruction: CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE,...
SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY AVG(Amount_Payment)
### Instruction: CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstandi...
SELECT first_name, last_name FROM customers
### 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 transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER 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 Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10...
SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details ORDER BY COUNT(lot_details)
### 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 T2.apt_type_code, T2.apt_number FROM apartment_buildings AS T1 JOIN apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle"
### Instruction: CREATE TABLE document_locations ( document_id number, location_code text, date_in_location_from time, date_in_locaton_to time ) CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text,...
SELECT location_code FROM document_locations GROUP BY location_code ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: 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_year text, death_month text, death_day text, death_country text, death_state text, death_city text, ...
SELECT player_id FROM player_award WHERE year = 2010 AND award_id = "Rookie of the Year"
### 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 Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, ...
SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements ORDER BY COUNT(Date_Claim_Settled) DESC
### Instruction: CREATE TABLE document_locations ( document_id number, location_code text, date_in_location_from time, date_in_locaton_to time ) CREATE TABLE documents_to_be_destroyed ( document_id number, destruction_authorised_by_employee_id number, destroyed_by_employee_id number, pl...
SELECT date_stored FROM all_documents WHERE document_name = "Marry CV"
### Instruction: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numcit...
SELECT DISTINCT author.authorname FROM author, keyphrase, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'Machine Learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid GROUP BY author.authorname ORDER BY COUNT(DISTINCT ...
### Instruction: CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATE...
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY Budget_Type_Code DESC
### Instruction: CREATE TABLE shipments ( shipment_id number, order_id number, invoice_number number, shipment_tracking_number text, shipment_date time, other_shipment_details text ) CREATE TABLE orders ( order_id number, customer_id number, order_status text, date_order_placed ...
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= "2009-01-01" AND T2.date_order_placed <= "2010-01-01"