input
stringlengths
191
7.13k
output
stringlengths
19
578
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_name , access_count FROM documents ORDER BY document_name;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_name , access_count FROM documents ORDER BY access_count DESC LIMIT 1;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_name , access_count FROM documents ORDER BY access_count DESC LIMIT 1;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 4;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 4;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT sum(access_count) FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT sum(access_count) FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT avg(access_count) FROM documents;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT avg(access_count) FROM documents;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_type_code FROM documents WHERE document_name = "David CV";
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_type_code FROM documents WHERE document_name = "David CV";
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING sum(access_count) > 10000;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING sum(access_count) > 10000;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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";
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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";
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_name FROM documents WHERE document_code NOT IN (SELECT document_code FROM document_sections);
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_name FROM documents WHERE document_code NOT IN (SELECT document_code FROM document_sections);
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT user_name , password FROM users GROUP BY role_code ORDER BY count(*) DESC LIMIT 1;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT user_name , password FROM users GROUP BY role_code ORDER BY count(*) DESC LIMIT 1;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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";
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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";
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_name FROM documents WHERE document_name LIKE "%CV%";
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_name FROM documents WHERE document_name LIKE "%CV%";
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT count(*) FROM users WHERE user_login = 1;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT count(*) FROM users WHERE user_login = 1;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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);
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
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);
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT image_name , image_url FROM images ORDER BY image_name;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT image_name , image_url FROM images ORDER BY image_name;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT count(*) , role_code FROM users GROUP BY role_code;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT count(*) , role_code FROM users GROUP BY role_code;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 2;
Tables: Roles, Users, Document_Structures, Functional_Areas, Images, Documents, Document_Functional_Areas, Document_Sections, Document_Sections_Images Columns: Roles.role_code, Roles.role_description, Users.user_id, Users.role_code, Users.user_name, Users.user_login, Users.password, Document_Structures.document_structu...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 2;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT count(*) FROM Companies;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT count(*) FROM Companies;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name FROM Companies ORDER BY Market_Value_billion DESC;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name FROM Companies ORDER BY Market_Value_billion DESC;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name FROM Companies WHERE Headquarters != 'USA';
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name FROM Companies WHERE Headquarters != 'USA';
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name , Assets_billion FROM Companies ORDER BY name ASC;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name , Assets_billion FROM Companies ORDER BY name ASC;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT avg(Profits_billion) FROM Companies;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT avg(Profits_billion) FROM Companies;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT max(Sales_billion) , min(Sales_billion) FROM Companies WHERE Industry != "Banking";
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT max(Sales_billion) , min(Sales_billion) FROM Companies WHERE Industry != "Banking";
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT count(DISTINCT Industry) FROM Companies;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT count(DISTINCT Industry) FROM Companies;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name FROM buildings ORDER BY Height DESC;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name FROM buildings ORDER BY Height DESC;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
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;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
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;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
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;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
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;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
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;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
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;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name FROM buildings WHERE Status = "on-hold" ORDER BY Stories ASC;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name FROM buildings WHERE Status = "on-hold" ORDER BY Stories ASC;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Industry , COUNT(*) FROM Companies GROUP BY Industry;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Industry , COUNT(*) FROM Companies GROUP BY Industry;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations);
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations);
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Industry FROM Companies WHERE Headquarters = "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = "China";
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Industry FROM Companies WHERE Headquarters = "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = "China";
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT count(*) FROM Companies WHERE Industry = "Banking" OR Industry = "Conglomerate";
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT count(*) FROM Companies WHERE Industry = "Banking" OR Industry = "Conglomerate";
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2;
Tables: buildings, Companies, Office_locations Columns: buildings.id, buildings.name, buildings.City, buildings.Height, buildings.Stories, buildings.Status, Companies.id, Companies.name, Companies.Headquarters, Companies.Industry, Companies.Sales_billion, Companies.Profits_billion, Companies.Assets_billion, Companies.M...
SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
SELECT count(*) FROM Products;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
SELECT Product_Name FROM Products ORDER BY Product_Price ASC;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
SELECT Product_Name , Product_Type_Code FROM Products;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
SELECT Product_Price FROM Products WHERE Product_Name = "Dining" OR Product_Name = "Trading Policy";
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
SELECT avg(Product_Price) FROM Products;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
SELECT Product_Type_Code , COUNT(*) FROM Products GROUP BY Product_Type_Code;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
SELECT Product_Type_Code FROM Products WHERE Product_Price > 4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price < 3000;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
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;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
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;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
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;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
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;
Tables: Addresses, Locations, Products, Parties, Assets, Channels, Finances, Events, Products_in_Events, Parties_in_Events, Agreements, Assets_in_Events Columns: Addresses.Address_ID, Addresses.address_details, Locations.Location_ID, Locations.Other_Details, Products.Product_ID, Products.Product_Type_Code, Products.Pro...
SELECT Product_Name FROM Products WHERE Product_ID NOT IN (SELECT Product_ID FROM Products_in_Events);
Tables: festival_detail, artwork, nomination Columns: festival_detail.Festival_ID, festival_detail.Festival_Name, festival_detail.Chair_Name, festival_detail.Location, festival_detail.Year, festival_detail.Num_of_Audience, artwork.Artwork_ID, artwork.Type, artwork.Name, nomination.Artwork_ID, nomination.Festival_ID, no...
SELECT count(*) FROM artwork;
Tables: festival_detail, artwork, nomination Columns: festival_detail.Festival_ID, festival_detail.Festival_Name, festival_detail.Chair_Name, festival_detail.Location, festival_detail.Year, festival_detail.Num_of_Audience, artwork.Artwork_ID, artwork.Type, artwork.Name, nomination.Artwork_ID, nomination.Festival_ID, no...
SELECT Name FROM artwork ORDER BY Name ASC;