db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
customer_complaints | select count(*) from customers group by customer_type_code order by count(*) desc limit 1 | Question: how many customers are there in the customer type with the most customers? | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Products -> product_i... | how many customers are there in the customer type with the most customers? |
customer_complaints | select count(*) from customers group by customer_type_code order by count(*) desc limit 1 | Question: count the number of customers that have the customer type that is most common. | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Products -> produ... | count the number of customers that have the customer type that is most common. |
customer_complaints | select t1.last_name from staff as t1 join complaints as t2 on t1.staff_id = t2.staff_id order by t2.date_complaint_raised limit 1 | Question: what is the last name of the staff who has handled the first ever complaint? | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Products -> product... | what is the last name of the staff who has handled the first ever complaint? |
customer_complaints | select t1.last_name from staff as t1 join complaints as t2 on t1.staff_id = t2.staff_id order by t2.date_complaint_raised limit 1 | Question: return the last name of the staff member who handled the complaint with the earliest date raised. | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number... | return the last name of the staff member who handled the complaint with the earliest date raised. |
customer_complaints | select count(distinct complaint_type_code) from complaints | Question: how many distinct complaint type codes are there in the database? | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Products -> product_id, parent... | how many distinct complaint type codes are there in the database? |
customer_complaints | select count(distinct complaint_type_code) from complaints | Question: count the number of different complaint type codes. | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Products -> product_id, parent_product_id, p... | count the number of different complaint type codes. |
customer_complaints | select address_line_1 , address_line_2 from customers where email_address = 'vbogisich@example.org' | Question: find the address line 1 and 2 of the customer with email 'vbogisich@example.org'. | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Products -> pr... | find the address line 1 and 2 of the customer with email 'vbogisich@example.org'. |
customer_complaints | select address_line_1 , address_line_2 from customers where email_address = 'vbogisich@example.org' | Question: what are lines 1 and 2 of the addressed of the customer with the email 'vbogisich@example.org'? | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. ... | what are lines 1 and 2 of the addressed of the customer with the email 'vbogisich@example.org'? |
customer_complaints | select complaint_status_code , count(*) from complaints where complaint_type_code = 'product failure' group by complaint_status_code | Question: find the number of complaints with product failure type for each complaint status. | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Products -> p... | find the number of complaints with product failure type for each complaint status. |
customer_complaints | select complaint_status_code , count(*) from complaints where complaint_type_code = 'product failure' group by complaint_status_code | Question: of complaints with the type code 'product failure', how many had each different status code? | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Pro... | of complaints with the type code 'product failure', how many had each different status code? |
customer_complaints | select t1.first_name from staff as t1 join complaints as t2 on t1.staff_id = t2.staff_id group by t2.staff_id order by count(*) limit 5 | Question: what is first names of the top 5 staff who have handled the greatest number of complaints? | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Produ... | what is first names of the top 5 staff who have handled the greatest number of complaints? |
customer_complaints | select t1.first_name from staff as t1 join complaints as t2 on t1.staff_id = t2.staff_id group by t2.staff_id order by count(*) limit 5 | Question: return the first names of the 5 staff members who have handled the most complaints. | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Products -> ... | return the first names of the 5 staff members who have handled the most complaints. |
customer_complaints | select state from customers group by state order by count(*) limit 1 | Question: which state has the most customers? | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Products -> product_id, parent_product_id, product_category_... | which state has the most customers? |
customer_complaints | select state from customers group by state order by count(*) limit 1 | Question: give the state that has the most customers. | Tables: Staff -> staff_id, gender, first_name, last_name, email_address, phone_number. Customers -> customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number. Products -> product_id, parent_product_id, product_c... | give the state that has the most customers. |
workshop_paper | select count(*) from submission | Question: how many submissions are there? | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submission.Submission_ID, | how many submissions are there? |
workshop_paper | select count(*) from submission | Question: count the number of submissions. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submission.Submission_ID, | count the number of submissions. |
workshop_paper | select author from submission order by scores asc | Question: list the authors of submissions in ascending order of scores. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submiss... | list the authors of submissions in ascending order of scores. |
workshop_paper | select author from submission order by scores asc | Question: find the author for each submission and list them in ascending order of submission score. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Accept... | find the author for each submission and list them in ascending order of submission score. |
workshop_paper | select author , college from submission | Question: what are the authors of submissions and their colleges? | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submission.Su... | what are the authors of submissions and their colleges? |
workshop_paper | select author , college from submission | Question: for each submission, show the author and their affiliated college. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = su... | for each submission, show the author and their affiliated college. |
workshop_paper | select author from submission where college = 'florida' or college = 'temple' | Question: show the names of authors from college 'florida' or 'temple' | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submissi... | show the names of authors from college 'florida' or 'temple' |
workshop_paper | select author from submission where college = 'florida' or college = 'temple' | Question: which authors with submissions are from college 'florida' or 'temple'? | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID ... | which authors with submissions are from college 'florida' or 'temple'? |
workshop_paper | select avg(scores) from submission | Question: what is the average score of submissions? | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submission.Submission_ID, | what is the average score of submissions? |
workshop_paper | select avg(scores) from submission | Question: compute the average score of submissions. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submission.Submission_ID, | compute the average score of submissions. |
workshop_paper | select author from submission order by scores desc limit 1 | Question: what is the author of the submission with the highest score? | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submissi... | what is the author of the submission with the highest score? |
workshop_paper | select author from submission order by scores desc limit 1 | Question: find the author who achieved the highest score in a submission. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submi... | find the author who achieved the highest score in a submission. |
workshop_paper | select college , count(*) from submission group by college | Question: show different colleges along with the number of authors of submission from each college. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Accept... | show different colleges along with the number of authors of submission from each college. |
workshop_paper | select college , count(*) from submission group by college | Question: for each college, return the college name and the count of authors with submissions from that college. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Worksh... | for each college, return the college name and the count of authors with submissions from that college. |
workshop_paper | select college from submission group by college order by count(*) desc limit 1 | Question: show the most common college of authors of submissions. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submission.Su... | show the most common college of authors of submissions. |
workshop_paper | select college from submission group by college order by count(*) desc limit 1 | Question: which college has the most authors with submissions? | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submission.Submi... | which college has the most authors with submissions? |
workshop_paper | select college from submission where scores > 90 intersect select college from submission where scores < 80 | Question: show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Wor... | show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80. |
workshop_paper | select college from submission where scores > 90 intersect select college from submission where scores < 80 | Question: which colleges have both authors with submission score above 90 and authors with submission score below 80? | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.W... | which colleges have both authors with submission score above 90 and authors with submission score below 80? |
workshop_paper | select t2.author , t1.result from acceptance as t1 join submission as t2 on t1.submission_id = t2.submission_id | Question: show the authors of submissions and the acceptance results of their submissions. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Subm... | show the authors of submissions and the acceptance results of their submissions. |
workshop_paper | select t2.author , t1.result from acceptance as t1 join submission as t2 on t1.submission_id = t2.submission_id | Question: for each submission, find its author and acceptance result. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submissio... | for each submission, find its author and acceptance result. |
workshop_paper | select t1.result from acceptance as t1 join submission as t2 on t1.submission_id = t2.submission_id order by t2.scores desc limit 1 | Question: show the result of the submission with the highest score. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submission.... | show the result of the submission with the highest score. |
workshop_paper | select t1.result from acceptance as t1 join submission as t2 on t1.submission_id = t2.submission_id order by t2.scores desc limit 1 | Question: which submission received the highest score in acceptance result. show me the result. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance... | which submission received the highest score in acceptance result. show me the result. |
workshop_paper | select t2.author , count(distinct t1.workshop_id) from acceptance as t1 join submission as t2 on t1.submission_id = t2.submission_id group by t2.author | Question: show each author and the number of workshops they submitted to. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submi... | show each author and the number of workshops they submitted to. |
workshop_paper | select t2.author , count(distinct t1.workshop_id) from acceptance as t1 join submission as t2 on t1.submission_id = t2.submission_id group by t2.author | Question: how many workshops did each author submit to? return the author name and the number of workshops. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID... | how many workshops did each author submit to? return the author name and the number of workshops. |
workshop_paper | select t2.author from acceptance as t1 join submission as t2 on t1.submission_id = t2.submission_id group by t2.author having count(distinct t1.workshop_id) > 1 | Question: show the authors who have submissions to more than one workshop. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = subm... | show the authors who have submissions to more than one workshop. |
workshop_paper | select t2.author from acceptance as t1 join submission as t2 on t1.submission_id = t2.submission_id group by t2.author having count(distinct t1.workshop_id) > 1 | Question: which authors have submitted to more than one workshop? | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submission.Su... | which authors have submitted to more than one workshop? |
workshop_paper | select date , venue from workshop order by venue | Question: show the date and venue of each workshop in ascending alphabetical order of the venue. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptanc... | show the date and venue of each workshop in ascending alphabetical order of the venue. |
workshop_paper | select date , venue from workshop order by venue | Question: sort the each workshop in alphabetical order of the venue. return the date and venue of each workshop. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Worksh... | sort the each workshop in alphabetical order of the venue. return the date and venue of each workshop. |
workshop_paper | select author from submission where submission_id not in (select submission_id from acceptance) | Question: list the authors who do not have submission to any workshop. | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submissi... | list the authors who do not have submission to any workshop. |
workshop_paper | select author from submission where submission_id not in (select submission_id from acceptance) | Question: which authors did not submit to any workshop? | Tables: workshop -> Workshop_ID, Date, Venue, Name. submission -> Submission_ID, Scores, Author, College. Acceptance -> Submission_ID, Workshop_ID, Result. | Joins: Acceptance.Workshop_ID = workshop.Workshop_ID, Acceptance.Submission_ID = submission.Submission_I... | which authors did not submit to any workshop? |
tracking_share_transactions | select count(*) from investors | Question: find the number of investors in total. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_transaction, amount_o... | find the number of investors in total. |
tracking_share_transactions | select investor_details from investors | Question: show all investor details. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_transaction, amount_of_transactio... | show all investor details. |
tracking_share_transactions | select distinct lot_details from lots | Question: show all distinct lot details. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_transaction, amount_of_transa... | show all distinct lot details. |
tracking_share_transactions | select max(amount_of_transaction) from transactions | Question: show the maximum amount of transaction. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_transaction, amount_... | show the maximum amount of transaction. |
tracking_share_transactions | select date_of_transaction , share_count from transactions | Question: show all date and share count of transactions. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_transaction, ... | show all date and share count of transactions. |
tracking_share_transactions | select sum(share_count) from transactions | Question: what is the total share of transactions? | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_transaction, amount... | what is the total share of transactions? |
tracking_share_transactions | select transaction_id from transactions where transaction_type_code = 'pur' | Question: show all transaction ids with transaction code 'pur'. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_transa... | show all transaction ids with transaction code 'pur'. |
tracking_share_transactions | select date_of_transaction from transactions where transaction_type_code = 'sale' | Question: show all dates of transactions whose type code is 'sale'. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_tr... | show all dates of transactions whose type code is 'sale'. |
tracking_share_transactions | select avg(amount_of_transaction) from transactions where transaction_type_code = 'sale' | Question: show the average amount of transactions with type code 'sale'. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_... | show the average amount of transactions with type code 'sale'. |
tracking_share_transactions | select transaction_type_description from ref_transaction_types where transaction_type_code = 'pur' | Question: show the description of transaction type with code 'pur'. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_tr... | show the description of transaction type with code 'pur'. |
tracking_share_transactions | select min(amount_of_transaction) from transactions where transaction_type_code = 'pur' and share_count > 50 | Question: show the minimum amount of transactions whose type code is 'pur' and whose share count is bigger than 50. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id... | show the minimum amount of transactions whose type code is 'pur' and whose share count is bigger than 50. |
tracking_share_transactions | select max(share_count) from transactions where amount_of_transaction < 10000 | Question: show the maximum share count of transactions where the amount is smaller than 10000 | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transac... | show the maximum share count of transactions where the amount is smaller than 10000 |
tracking_share_transactions | select date_of_transaction from transactions where share_count > 100 or amount_of_transaction > 1000 | Question: show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, ... | show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000. |
tracking_share_transactions | select t1.transaction_type_description , t2.date_of_transaction from ref_transaction_types as t1 join transactions as t2 on t1.transaction_type_code = t2.transaction_type_code where t2.share_count < 10 | Question: show the transaction type descriptions and dates if the share count is smaller than 10. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, tra... | show the transaction type descriptions and dates if the share count is smaller than 10. |
tracking_share_transactions | select t1.investor_details from investors as t1 join transactions as t2 on t1.investor_id = t2.investor_id where t2.share_count > 100 | Question: show details of all investors if they make any transaction with share count greater than 100. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_i... | show details of all investors if they make any transaction with share count greater than 100. |
tracking_share_transactions | select count(distinct transaction_type_code) from transactions | Question: how many distinct transaction types are used in the transactions? | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, da... | how many distinct transaction types are used in the transactions? |
tracking_share_transactions | select lot_details , investor_id from lots | Question: return the lot details and investor ids. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_transaction, amount... | return the lot details and investor ids. |
tracking_share_transactions | select t2.lot_details from investors as t1 join lots as t2 on t1.investor_id = t2.investor_id where t1.investor_details = 'l' | Question: return the lot details of lots that belong to investors with details 'l'? | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_... | return the lot details of lots that belong to investors with details 'l'? |
tracking_share_transactions | select t1.purchase_details from purchases as t1 join transactions as t2 on t1.purchase_transaction_id = t2.transaction_id where t2.amount_of_transaction > 10000 | Question: what are the purchase details of transactions with amount bigger than 10000? | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_ty... | what are the purchase details of transactions with amount bigger than 10000? |
tracking_share_transactions | select t1.sales_details , t2.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 | Question: what are the sale details and dates of transactions with amount smaller than 3000? | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transact... | what are the sale details and dates of transactions with amount smaller than 3000? |
tracking_share_transactions | select t1.lot_details from lots as t1 join transactions_lots as t2 on t1.lot_id = t2.transaction_id join transactions as t3 on t2.transaction_id = t3.transaction_id where t3.share_count < 50 | Question: what are the lot details of lots associated with transactions with share count smaller than 50? | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor... | what are the lot details of lots associated with transactions with share count smaller than 50? |
tracking_share_transactions | select t1.lot_details from lots as t1 join transactions_lots as t2 on t1.lot_id = t2.transaction_id join transactions as t3 on t2.transaction_id = t3.transaction_id where t3.share_count > 100 and t3.transaction_type_code = 'pur' | Question: what are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is 'pur'? | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transac... | what are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is 'pur'? |
tracking_share_transactions | select transaction_type_code , avg(amount_of_transaction) from transactions group by transaction_type_code | Question: show the average transaction amount for different transaction types. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code,... | show the average transaction amount for different transaction types. |
tracking_share_transactions | select transaction_type_code , max(share_count) , min(share_count) from transactions group by transaction_type_code | Question: show the maximum and minimum share count of different transaction types. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_c... | show the maximum and minimum share count of different transaction types. |
tracking_share_transactions | select investor_id , avg(share_count) from transactions group by investor_id | Question: show the average share count of transactions for different investors. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code... | show the average share count of transactions for different investors. |
tracking_share_transactions | select investor_id , avg(share_count) from transactions group by investor_id order by avg(share_count) | Question: show the average share count of transactions each each investor, ordered by average share count. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investo... | show the average share count of transactions each each investor, ordered by average share count. |
tracking_share_transactions | select investor_id , avg(amount_of_transaction) from transactions group by investor_id | Question: show the average amount of transactions for different investors. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, dat... | show the average amount of transactions for different investors. |
tracking_share_transactions | select t2.lot_id , avg(amount_of_transaction) from transactions as t1 join transactions_lots as t2 on t1.transaction_id = t2.transaction_id group by t2.lot_id | Question: show the average amount of transactions for different lots. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_... | show the average amount of transactions for different lots. |
tracking_share_transactions | select t2.lot_id , avg(amount_of_transaction) from transactions as t1 join transactions_lots as t2 on t1.transaction_id = t2.transaction_id group by t2.lot_id order by avg(amount_of_transaction) | Question: show the average amount of transactions for different lots, ordered by average amount of transactions. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, i... | show the average amount of transactions for different lots, ordered by average amount of transactions. |
tracking_share_transactions | select investor_id , count(*) from transactions where transaction_type_code = 'sale' group by investor_id | Question: show the number of transactions with transaction type code 'sale' for different investors if it is larger than 0. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transa... | show the number of transactions with transaction type code 'sale' for different investors if it is larger than 0. |
tracking_share_transactions | select investor_id , count(*) from transactions group by investor_id | Question: show the number of transactions for different investors. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_tra... | show the number of transactions for different investors. |
tracking_share_transactions | select transaction_type_code from transactions group by transaction_type_code order by count(*) asc limit 1 | Question: show the transaction type code that occurs the fewest times. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of... | show the transaction type code that occurs the fewest times. |
tracking_share_transactions | select transaction_type_code from transactions group by transaction_type_code order by count(*) desc limit 1 | Question: show the transaction type code that occurs the most frequently. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date... | show the transaction type code that occurs the most frequently. |
tracking_share_transactions | select t1.transaction_type_description from ref_transaction_types as t1 join transactions as t2 on t1.transaction_type_code = t2.transaction_type_code group by t1.transaction_type_code order by count(*) desc limit 1 | Question: show the description of the transaction type that occurs most frequently. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_... | show the description of the transaction type that occurs most frequently. |
tracking_share_transactions | select t2.investor_id , t1.investor_details from investors as t1 join transactions as t2 on t1.investor_id = t2.investor_id group by t2.investor_id order by count(*) desc limit 1 | Question: show the id and details of the investor that has the largest number of transactions. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transa... | show the id and details of the investor that has the largest number of transactions. |
tracking_share_transactions | select t2.investor_id , t1.investor_details from investors as t1 join transactions as t2 on t1.investor_id = t2.investor_id group by t2.investor_id order by count(*) desc limit 3 | Question: show the id and details for the investors who have the top 3 number of transactions. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transa... | show the id and details for the investors who have the top 3 number of transactions. |
tracking_share_transactions | select t2.investor_id from investors as t1 join transactions as t2 on t1.investor_id = t2.investor_id group by t2.investor_id having count(*) >= 2 | Question: show the ids of the investors who have at least two transactions. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, da... | show the ids of the investors who have at least two transactions. |
tracking_share_transactions | select t2.investor_id , t1.investor_details from investors as t1 join transactions as t2 on t1.investor_id = t2.investor_id where t2.transaction_type_code = 'sale' group by t2.investor_id having count(*) >= 2 | Question: show the ids and details of the investors who have at least two transactions with type code 'sale'. | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, inve... | show the ids and details of the investors who have at least two transactions with type code 'sale'. |
tracking_share_transactions | select date_of_transaction from transactions where share_count >= 100 or amount_of_transaction >= 100 | Question: what are the dates of transactions with at least 100 share count or amount bigger than 100? | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id,... | what are the dates of transactions with at least 100 share count or amount bigger than 100? |
tracking_share_transactions | select sales_details from sales union select purchase_details from purchases | Question: what are the details of all sales and purchases? | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_code, date_of_transaction... | what are the details of all sales and purchases? |
tracking_share_transactions | select lot_details from lots except select t1.lot_details from lots as t1 join transactions_lots as t2 on t1.lot_id = t2.lot_id | Question: what are the details of the lots which are not used in any transactions? | Tables: Investors -> investor_id, Investor_details. Lots -> lot_id, investor_id, lot_details. Ref_Transaction_Types -> transaction_type_code, transaction_type_description. Transactions -> transaction_id, investor_id, transaction_type_c... | what are the details of the lots which are not used in any transactions? |
cre_Theme_park | select count(*) from hotels | Question: how many available hotels are there in total? | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Details. Feat... | how many available hotels are there in total? |
cre_Theme_park | select count(*) from hotels | Question: find the total number of available hotels. | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Details. Feature... | find the total number of available hotels. |
cre_Theme_park | select price_range from hotels | Question: what are the price ranges of hotels? | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Details. Features -> F... | what are the price ranges of hotels? |
cre_Theme_park | select price_range from hotels | Question: tell me the price ranges for all the hotels. | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Details. Featu... | tell me the price ranges for all the hotels. |
cre_Theme_park | select distinct location_name from locations | Question: show all distinct location names. | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Details. Features -> Feat... | show all distinct location names. |
cre_Theme_park | select distinct location_name from locations | Question: what are the distinct location names? | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Details. Features -> ... | what are the distinct location names? |
cre_Theme_park | select name , other_details from staff | Question: show the names and details of all the staff members. | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Detail... | show the names and details of all the staff members. |
cre_Theme_park | select name , other_details from staff | Question: what is the name and detail of each staff member? | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Details. ... | what is the name and detail of each staff member? |
cre_Theme_park | select tourist_details from visitors | Question: show details of all visitors. | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Details. Features -> Feature_... | show details of all visitors. |
cre_Theme_park | select tourist_details from visitors | Question: what is the detail of each visitor? | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Details. Features -> Fe... | what is the detail of each visitor? |
cre_Theme_park | select price_range from hotels where star_rating_code = '5' | Question: show the price ranges of hotels with 5 star ratings. | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Detail... | show the price ranges of hotels with 5 star ratings. |
cre_Theme_park | select price_range from hotels where star_rating_code = '5' | Question: what are the price ranges of five star hotels? | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Details. Fea... | what are the price ranges of five star hotels? |
cre_Theme_park | select avg(price_range) from hotels where star_rating_code = '5' and pets_allowed_yn = 1 | Question: show the average price range of hotels that have 5 star ratings and allow pets. | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors ->... | show the average price range of hotels that have 5 star ratings and allow pets. |
cre_Theme_park | select avg(price_range) from hotels where star_rating_code = '5' and pets_allowed_yn = 1 | Question: what is the average price range of five star hotels that allow pets? | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID... | what is the average price range of five star hotels that allow pets? |
cre_Theme_park | select address from locations where location_name = 'uk gallery' | Question: what is the address of the location 'uk gallery'? | Tables: Ref_Hotel_Star_Ratings -> star_rating_code, star_rating_description. Locations -> Location_ID, Location_Name, Address, Other_Details. Ref_Attraction_Types -> Attraction_Type_Code, Attraction_Type_Description. Visitors -> Tourist_ID, Tourist_Details. ... | what is the address of the location 'uk gallery'? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.