human
Schema:
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_functional_area_code, functional_area_description)
Images (image_id, image_alt_text, image_name, image_url)
Documents (document_code, document_structure_code, document_type_code, access_count, document_name)
Document_Functional_Areas (document_code, functional_area_code)
Document_Sections (section_id, document_code, section_sequence, section_code, section_title)
Document_Sections_Images (section_id, image_id)
Please answer with SQL.
assistant
Sure, I understand.
human
Hi there! Can you show me a list of all of the different document names and the associated access count for each of them?
assistant
SELECT document_name , access_count FROM documents;
human
Wonderful! Can you show me the associated structure code for each of those document names?
assistant
SELECT document_structure_code FROM documents;
human
Can you filter that list to show the document name and document structure code with the fewest document structure code entries, or in other words, the least popular structure?
assistant
SELECT document_name , document_structure_code FROM documents WHERE document_structure_code = ( SELECT MIN( document_structure_code ) FROM documents ) ;