db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
document_management
select document_name , access_count from documents order by document_name
Question: what are the names of all the documents, as well as the access counts of each, ordered alphabetically? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structur...
what are the names of all the documents, as well as the access counts of each, ordered alphabetically?
document_management
select document_name , access_count from documents order by access_count desc limit 1
Question: find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_d...
find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed?
document_management
select document_name , access_count from documents order by access_count desc limit 1
Question: what is the name of the document which has been accessed the most times, as well as the number of times it has been accessed? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_...
what is the name of the document which has been accessed the most times, as well as the number of times it has been accessed?
document_management
select document_type_code from documents group by document_type_code having count(*) > 4
Question: find the types of documents with more than 4 documents. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functional_a...
find the types of documents with more than 4 documents.
document_management
select document_type_code from documents group by document_type_code having count(*) > 4
Question: what are the codes of types of documents of which there are for or more? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Area...
what are the codes of types of documents of which there are for or more?
document_management
select sum(access_count) from documents group by document_type_code order by count(*) desc limit 1
Question: find the total access count of all documents in the most popular document type. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Function...
find the total access count of all documents in the most popular document type.
document_management
select sum(access_count) from documents group by document_type_code order by count(*) desc limit 1
Question: what is the total access count of documents that are of the most common document type? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. F...
what is the total access count of documents that are of the most common document type?
document_management
select avg(access_count) from documents
Question: what is the average access count of documents? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functional_area_code,...
what is the average access count of documents?
document_management
select avg(access_count) from documents
Question: find the average access count across all documents? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functional_area_...
find the average access count across all documents?
document_management
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
Question: what is the structure of the document with the least number of accesses? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Area...
what is the structure of the document with the least number of accesses?
document_management
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
Question: return the structure description of the document that has been accessed the fewest number of times. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_d...
return the structure description of the document that has been accessed the fewest number of times.
document_management
select document_type_code from documents where document_name = 'david cv'
Question: what is the type of the document named 'david cv'? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functional_area_c...
what is the type of the document named 'david cv'?
document_management
select document_type_code from documents where document_name = 'david cv'
Question: return the type code of the document named 'david cv'. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functional_ar...
return the type code of the document named 'david cv'.
document_management
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
Question: find the list of documents that are both in the most three popular type and have the most three popular structure. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, docum...
find the list of documents that are both in the most three popular type and have the most three popular structure.
document_management
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
Question: what are the names of documents that have both one of the three most common types and one of three most common structures? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_cod...
what are the names of documents that have both one of the three most common types and one of three most common structures?
document_management
select document_type_code from documents group by document_type_code having sum(access_count) > 10000
Question: what document types do have more than 10000 total access number. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> fun...
what document types do have more than 10000 total access number.
document_management
select document_type_code from documents group by document_type_code having sum(access_count) > 10000
Question: return the codes of the document types that do not have a total access count of over 10000. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_descripti...
return the codes of the document types that do not have a total access count of over 10000.
document_management
select t2.section_title from documents as t1 join document_sections as t2 on t1.document_code = t2.document_code where t1.document_name = 'david cv'
Question: what are all the section titles of the document named 'david cv'? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> fu...
what are all the section titles of the document named 'david cv'?
document_management
select t2.section_title from documents as t1 join document_sections as t2 on t1.document_code = t2.document_code where t1.document_name = 'david cv'
Question: give the section titles of the document with the name 'david cv'. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> fu...
give the section titles of the document with the name 'david cv'.
document_management
select document_name from documents where document_code not in (select document_code from document_sections)
Question: find all the name of documents without any sections. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functional_area...
find all the name of documents without any sections.
document_management
select document_name from documents where document_code not in (select document_code from document_sections)
Question: what are the names of documents that do not have any sections? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> funct...
what are the names of documents that do not have any sections?
document_management
select user_name , password from users group by role_code order by count(*) desc limit 1
Question: list all the username and passwords of users with the most popular role. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Area...
list all the username and passwords of users with the most popular role.
document_management
select user_name , password from users group by role_code order by count(*) desc limit 1
Question: what are the usernames and passwords of users that have the most common role? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional...
what are the usernames and passwords of users that have the most common role?
document_management
select avg(t1.access_count) from documents as t1 join document_functional_areas as t2 on t1.document_code = t2.document_code join functional_areas as t3 on t2.functional_area_code = t3.functional_area_code where t3.functional_area_description = 'acknowledgement'
Question: find the average access counts of documents with functional area 'acknowledgement'. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Func...
find the average access counts of documents with functional area 'acknowledgement'.
document_management
select avg(t1.access_count) from documents as t1 join document_functional_areas as t2 on t1.document_code = t2.document_code join functional_areas as t3 on t2.functional_area_code = t3.functional_area_code where t3.functional_area_description = 'acknowledgement'
Question: what are the average access counts of documents that have the functional area description 'acknowledgement'? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_st...
what are the average access counts of documents that have the functional area description 'acknowledgement'?
document_management
select document_name from documents except select t1.document_name from documents as t1 join document_sections as t2 on t1.document_code = t2.document_code join document_sections_images as t3 on t2.section_id = t3.section_id
Question: find names of the document without any images. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functional_area_code,...
find names of the document without any images.
document_management
select document_name from documents except select t1.document_name from documents as t1 join document_sections as t2 on t1.document_code = t2.document_code join document_sections_images as t3 on t2.section_id = t3.section_id
Question: what are the names of documents that do not have any images? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functio...
what are the names of documents that do not have any images?
document_management
select t1.document_name from documents as t1 join document_sections as t2 on t1.document_code = t2.document_code group by t1.document_code order by count(*) desc limit 1
Question: what is the name of the document with the most number of sections? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> f...
what is the name of the document with the most number of sections?
document_management
select t1.document_name from documents as t1 join document_sections as t2 on t1.document_code = t2.document_code group by t1.document_code order by count(*) desc limit 1
Question: return the name of the document that has the most sections. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> function...
return the name of the document that has the most sections.
document_management
select document_name from documents where document_name like '%cv%'
Question: list all the document names which contains 'cv'. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functional_area_cod...
list all the document names which contains 'cv'.
document_management
select document_name from documents where document_name like '%cv%'
Question: what are the names of documents that contain the substring 'cv'? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> fun...
what are the names of documents that contain the substring 'cv'?
document_management
select count(*) from users where user_login = 1
Question: how many users are logged in? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functional_area_code, parent_functiona...
how many users are logged in?
document_management
select count(*) from users where user_login = 1
Question: count the number of users that are logged in. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functional_area_code, ...
count the number of users that are logged in.
document_management
select role_description from roles where role_code = (select role_code from users where user_login = 1 group by role_code order by count(*) desc limit 1)
Question: find the description of the most popular role among the users that have logged in. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Funct...
find the description of the most popular role among the users that have logged in.
document_management
select role_description from roles where role_code = (select role_code from users where user_login = 1 group by role_code order by count(*) desc limit 1)
Question: what is the description of the most popular role among users that have logged in? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functi...
what is the description of the most popular role among users that have logged in?
document_management
select avg(access_count) from documents group by document_structure_code order by count(*) asc limit 1
Question: find the average access count of documents with the least popular structure. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_...
find the average access count of documents with the least popular structure.
document_management
select avg(access_count) from documents group by document_structure_code order by count(*) asc limit 1
Question: what is the average access count of documents that have the least common structure? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Func...
what is the average access count of documents that have the least common structure?
document_management
select image_name , image_url from images order by image_name
Question: list all the image name and urls in the order of their names. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functi...
list all the image name and urls in the order of their names.
document_management
select image_name , image_url from images order by image_name
Question: what are the names and urls of images, sorted alphabetically? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functi...
what are the names and urls of images, sorted alphabetically?
document_management
select count(*) , role_code from users group by role_code
Question: find the number of users in each role. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functional_area_code, parent_...
find the number of users in each role.
document_management
select count(*) , role_code from users group by role_code
Question: what are the different role codes for users, and how many users have each? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Ar...
what are the different role codes for users, and how many users have each?
document_management
select document_type_code from documents group by document_type_code having count(*) > 2
Question: what document types have more than 2 corresponding documents? | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Functional_Areas -> functi...
what document types have more than 2 corresponding documents?
document_management
select document_type_code from documents group by document_type_code having count(*) > 2
Question: give the codes of document types that have more than 2 corresponding documents. | Tables: Roles -> role_code, role_description. Users -> user_id, role_code, user_name, user_login, password. Document_Structures -> document_structure_code, parent_document_structure_code, document_structure_description. Function...
give the codes of document types that have more than 2 corresponding documents.
company_office
select count(*) from companies
Question: how many companies are there? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Office_locations.company_id = C...
how many companies are there?
company_office
select count(*) from companies
Question: count the number of companies. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Office_locations.company_id = ...
count the number of companies.
company_office
select name from companies order by market_value_billion desc
Question: list the names of companies in descending order of market value. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joi...
list the names of companies in descending order of market value.
company_office
select name from companies order by market_value_billion desc
Question: sort the company names in descending order of the company's market value. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_ye...
sort the company names in descending order of the company's market value.
company_office
select name from companies where headquarters != 'usa'
Question: what are the names of companies whose headquarters are not 'usa'? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Jo...
what are the names of companies whose headquarters are not 'usa'?
company_office
select name from companies where headquarters != 'usa'
Question: find the names of the companies whose headquarters are not located in 'usa'. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in...
find the names of the companies whose headquarters are not located in 'usa'.
company_office
select name , assets_billion from companies order by name asc
Question: what are the name and assets of each company, sorted in ascending order of company name? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company...
what are the name and assets of each company, sorted in ascending order of company name?
company_office
select name , assets_billion from companies order by name asc
Question: list the name and assets of each company in ascending order of company name. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in...
list the name and assets of each company in ascending order of company name.
company_office
select avg(profits_billion) from companies
Question: what are the average profits of companies? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Office_locations.c...
what are the average profits of companies?
company_office
select avg(profits_billion) from companies
Question: compute the average profits companies make. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Office_locations....
compute the average profits companies make.
company_office
select max(sales_billion) , min(sales_billion) from companies where industry != 'banking'
Question: what are the maximum and minimum sales of the companies whose industries are not 'banking'. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, comp...
what are the maximum and minimum sales of the companies whose industries are not 'banking'.
company_office
select max(sales_billion) , min(sales_billion) from companies where industry != 'banking'
Question: find the maximum and minimum sales of the companies that are not in the 'banking' industry. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, comp...
find the maximum and minimum sales of the companies that are not in the 'banking' industry.
company_office
select count(distinct industry) from companies
Question: how many different industries are the companies in? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Office_lo...
how many different industries are the companies in?
company_office
select count(distinct industry) from companies
Question: count the number of distinct company industries. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Office_locat...
count the number of distinct company industries.
company_office
select name from buildings order by height desc
Question: list the names of buildings in descending order of building height. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | ...
list the names of buildings in descending order of building height.
company_office
select name from buildings order by height desc
Question: what are the names of buildings sorted in descending order of building height? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_...
what are the names of buildings sorted in descending order of building height?
company_office
select stories from buildings order by height desc limit 1
Question: find the stories of the building with the largest height. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Off...
find the stories of the building with the largest height.
company_office
select stories from buildings order by height desc limit 1
Question: what is the stories of highest building? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Office_locations.com...
what is the stories of highest building?
company_office
select t3.name , t2.name from office_locations as t1 join buildings as t2 on t1.building_id = t2.id join companies as t3 on t1.company_id = t3.id
Question: list the name of a building along with the name of a company whose office is in the building. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, co...
list the name of a building along with the name of a company whose office is in the building.
company_office
select t3.name , t2.name from office_locations as t1 join buildings as t2 on t1.building_id = t2.id join companies as t3 on t1.company_id = t3.id
Question: for each company, return the company name and the name of the building its office is located in. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id,...
for each company, return the company name and the name of the building its office is located in.
company_office
select t2.name from office_locations as t1 join buildings as t2 on t1.building_id = t2.id join companies as t3 on t1.company_id = t3.id group by t1.building_id having count(*) > 1
Question: show the names of the buildings that have more than one company offices. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_yea...
show the names of the buildings that have more than one company offices.
company_office
select t2.name from office_locations as t1 join buildings as t2 on t1.building_id = t2.id join companies as t3 on t1.company_id = t3.id group by t1.building_id having count(*) > 1
Question: which buildings have more than one company offices? give me the building names. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move...
which buildings have more than one company offices? give me the building names.
company_office
select t2.name from office_locations as t1 join buildings as t2 on t1.building_id = t2.id join companies as t3 on t1.company_id = t3.id group by t1.building_id order by count(*) desc limit 1
Question: show the name of the building that has the most company offices. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joi...
show the name of the building that has the most company offices.
company_office
select t2.name from office_locations as t1 join buildings as t2 on t1.building_id = t2.id join companies as t3 on t1.company_id = t3.id group by t1.building_id order by count(*) desc limit 1
Question: which building has the largest number of company offices? give me the building name. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id,...
which building has the largest number of company offices? give me the building name.
company_office
select name from buildings where status = 'on-hold' order by stories asc
Question: please show the names of the buildings whose status is 'on-hold', in ascending order of stories. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id,...
please show the names of the buildings whose status is 'on-hold', in ascending order of stories.
company_office
select name from buildings where status = 'on-hold' order by stories asc
Question: find the names of the buildings in 'on-hold' status, and sort them in ascending order of building stories. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> bu...
find the names of the buildings in 'on-hold' status, and sort them in ascending order of building stories.
company_office
select industry , count(*) from companies group by industry
Question: please show each industry and the corresponding number of companies in that industry. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id...
please show each industry and the corresponding number of companies in that industry.
company_office
select industry , count(*) from companies group by industry
Question: whah are the name of each industry and the number of companies in that industry? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, mov...
whah are the name of each industry and the number of companies in that industry?
company_office
select industry from companies group by industry order by count(*) desc
Question: please show the industries of companies in descending order of the number of companies. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_...
please show the industries of companies in descending order of the number of companies.
company_office
select industry from companies group by industry order by count(*) desc
Question: sort all the industries in descending order of the count of companies in each industry | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_i...
sort all the industries in descending order of the count of companies in each industry
company_office
select industry from companies group by industry order by count(*) desc limit 1
Question: list the industry shared by the most companies. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Office_locati...
list the industry shared by the most companies.
company_office
select industry from companies group by industry order by count(*) desc limit 1
Question: which industry has the most companies? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Office_locations.compa...
which industry has the most companies?
company_office
select name from buildings where id not in (select building_id from office_locations)
Question: list the names of buildings that have no company office. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Offi...
list the names of buildings that have no company office.
company_office
select name from buildings where id not in (select building_id from office_locations)
Question: which buildings do not have any company office? give me the building names. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_...
which buildings do not have any company office? give me the building names.
company_office
select industry from companies where headquarters = 'usa' intersect select industry from companies where headquarters = 'china'
Question: show the industries shared by companies whose headquarters are 'usa' and companies whose headquarters are 'china'. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locatio...
show the industries shared by companies whose headquarters are 'usa' and companies whose headquarters are 'china'.
company_office
select industry from companies where headquarters = 'usa' intersect select industry from companies where headquarters = 'china'
Question: which industries have both companies with headquarter in 'usa' and companies with headquarter in 'china'? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> bui...
which industries have both companies with headquarter in 'usa' and companies with headquarter in 'china'?
company_office
select count(*) from companies where industry = 'banking' or industry = 'conglomerate'
Question: find the number of companies whose industry is 'banking' or 'conglomerate', | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_...
find the number of companies whose industry is 'banking' or 'conglomerate',
company_office
select count(*) from companies where industry = 'banking' or industry = 'conglomerate'
Question: how many companies are in either 'banking' industry or 'conglomerate' industry? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move...
how many companies are in either 'banking' industry or 'conglomerate' industry?
company_office
select headquarters from companies group by headquarters having count(*) > 2
Question: show the headquarters shared by more than two companies. | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins: Offi...
show the headquarters shared by more than two companies.
company_office
select headquarters from companies group by headquarters having count(*) > 2
Question: which headquarter locations are used by more than 2 companies? | Tables: buildings -> id, name, City, Height, Stories, Status. Companies -> id, name, Headquarters, Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value_billion. Office_locations -> building_id, company_id, move_in_year. | Joins...
which headquarter locations are used by more than 2 companies?
solvency_ii
select count(*) from products
Question: how many products are there? | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Other_Details. Channels -> Channel_ID, Other_Details. Financ...
how many products are there?
solvency_ii
select product_name from products order by product_price asc
Question: list the name of products in ascending order of price. | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Other_Details. Channels -> Channel...
list the name of products in ascending order of price.
solvency_ii
select product_name , product_type_code from products
Question: what are the names and type codes of products? | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Other_Details. Channels -> Channel_ID, Oth...
what are the names and type codes of products?
solvency_ii
select product_price from products where product_name = 'dining' or product_name = 'trading policy'
Question: show the prices of the products named 'dining' or 'trading policy'. | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Other_Details. Channe...
show the prices of the products named 'dining' or 'trading policy'.
solvency_ii
select avg(product_price) from products
Question: what is the average price for products? | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Other_Details. Channels -> Channel_ID, Other_Deta...
what is the average price for products?
solvency_ii
select product_name from products order by product_price desc limit 1
Question: what is the name of the product with the highest price? | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Other_Details. Channels -> Channe...
what is the name of the product with the highest price?
solvency_ii
select product_type_code , count(*) from products group by product_type_code
Question: show different type codes of products and the number of products with each type code. | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Oth...
show different type codes of products and the number of products with each type code.
solvency_ii
select product_type_code from products group by product_type_code order by count(*) desc limit 1
Question: show the most common type code across products. | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Other_Details. Channels -> Channel_ID, Ot...
show the most common type code across products.
solvency_ii
select product_type_code from products group by product_type_code having count(*) >= 2
Question: show the product type codes that have at least two products. | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Other_Details. Channels -> C...
show the product type codes that have at least two products.
solvency_ii
select product_type_code from products where product_price > 4500 intersect select product_type_code from products where product_price < 3000
Question: show the product type codes that have both products with price higher than 4500 and products with price lower than 3000. | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Par...
show the product type codes that have both products with price higher than 4500 and products with price lower than 3000.
solvency_ii
select t1.product_name , count(*) from products as t1 join products_in_events as t2 on t1.product_id = t2.product_id group by t1.product_name
Question: show the names of products and the number of events they are in. | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Other_Details. Channels ...
show the names of products and the number of events they are in.
solvency_ii
select t1.product_name , count(*) from products as t1 join products_in_events as t2 on t1.product_id = t2.product_id group by t1.product_name order by count(*) desc
Question: show the names of products and the number of events they are in, sorted by the number of events in descending order. | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_D...
show the names of products and the number of events they are in, sorted by the number of events in descending order.
solvency_ii
select t1.product_name from products as t1 join products_in_events as t2 on t1.product_id = t2.product_id group by t1.product_name having count(*) >= 2
Question: show the names of products that are in at least two events. | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Other_Details. Channels -> Ch...
show the names of products that are in at least two events.
solvency_ii
select t1.product_name from products as t1 join products_in_events as t2 on t1.product_id = t2.product_id group by t1.product_name having count(*) >= 2 order by t1.product_name
Question: show the names of products that are in at least two events in ascending alphabetical order of product name. | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. A...
show the names of products that are in at least two events in ascending alphabetical order of product name.
solvency_ii
select product_name from products where product_id not in (select product_id from products_in_events)
Question: list the names of products that are not in any event. | Tables: Addresses -> Address_ID, address_details. Locations -> Location_ID, Other_Details. Products -> Product_ID, Product_Type_Code, Product_Name, Product_Price. Parties -> Party_ID, Party_Details. Assets -> Asset_ID, Other_Details. Channels -> Channel_...
list the names of products that are not in any event.
entertainment_awards
select count(*) from artwork
Question: how many artworks are there? | Tables: festival_detail -> Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience. artwork -> Artwork_ID, Type, Name. nomination -> Artwork_ID, Festival_ID, Result. | Joins: nomination.Festival_ID = festival_detail.Festival_ID, nomination.Artwork_ID = artwork.Ar...
how many artworks are there?
entertainment_awards
select name from artwork order by name asc
Question: list the name of artworks in ascending alphabetical order. | Tables: festival_detail -> Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience. artwork -> Artwork_ID, Type, Name. nomination -> Artwork_ID, Festival_ID, Result. | Joins: nomination.Festival_ID = festival_detail.Festival_ID, nomi...
list the name of artworks in ascending alphabetical order.