output
stringlengths 18
577
| instruction
stringlengths 16
224
| input
stringclasses 160
values |
---|---|---|
SELECT document_id , document_name , document_description FROM Documents | What are the ids, names, and descriptions for all documents? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_name , template_id FROM Documents WHERE Document_Description LIKE "%w%" | What is the document name and template id for document with description with the letter 'w' in it? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_name , template_id FROM Documents WHERE Document_Description LIKE "%w%" | Return the names and template ids for documents that contain the letter w in their description. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id , template_id , Document_Description FROM Documents WHERE document_name = "Robbin CV" | What is the document id, template id and description for document named "Robbin CV"? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id , template_id , Document_Description FROM Documents WHERE document_name = "Robbin CV" | Return the document id, template id, and description for the document with the name Robbin CV. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(DISTINCT template_id) FROM Documents | How many different templates do all document use? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(DISTINCT template_id) FROM Documents | Count the number of different templates used for documents. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT' | How many documents are using the template with type code 'PPT'? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT' | Count the number of documents that use the PPT template type. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_id , count(*) FROM Documents GROUP BY template_id | Show all template ids and number of documents using each template. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_id , count(*) FROM Documents GROUP BY template_id | What are all different template ids used for documents, and how many times were each of them used? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.template_id , T2.Template_Type_Code FROM Documents AS T1 JOIN Templates AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_id ORDER BY count(*) DESC LIMIT 1 | What is the id and type code for the template used by the most documents? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.template_id , T2.Template_Type_Code FROM Documents AS T1 JOIN Templates AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_id ORDER BY count(*) DESC LIMIT 1 | Return the id and type code of the template that is used for the greatest number of documents. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_id FROM Documents GROUP BY template_id HAVING count(*) > 1 | Show ids for all templates that are used by more than one document. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_id FROM Documents GROUP BY template_id HAVING count(*) > 1 | What are the template ids of any templates used in more than a single document? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents | Show ids for all templates not used by any document. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents | What are the ids for templates that are not used in any documents? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(*) FROM Templates | How many templates do we have? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(*) FROM Templates | Count the number of templates. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_id , version_number , template_type_code FROM Templates | Show template ids, version numbers, and template type codes for all templates. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_id , version_number , template_type_code FROM Templates | What are the ids, version numbers, and type codes for each template? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT DISTINCT template_type_code FROM Templates | Show all distinct template type codes for all templates. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT DISTINCT template_type_code FROM Templates | What are the different template type codes? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_id FROM Templates WHERE template_type_code = "PP" OR template_type_code = "PPT" | What are the ids of templates with template type code PP or PPT? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_id FROM Templates WHERE template_type_code = "PP" OR template_type_code = "PPT" | Return the ids of templates that have the code PP or PPT. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(*) FROM Templates WHERE template_type_code = "CV" | How many templates have template type code CV? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(*) FROM Templates WHERE template_type_code = "CV" | Count the number of templates of the type CV. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT version_number , template_type_code FROM Templates WHERE version_number > 5 | What is the version number and template type code for the template with version number later than 5? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT version_number , template_type_code FROM Templates WHERE version_number > 5 | Return the version numbers and template type codes of templates with a version number greater than 5. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code , count(*) FROM Templates GROUP BY template_type_code | Show all template type codes and number of templates for each. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code , count(*) FROM Templates GROUP BY template_type_code | What are the different template type codes, and how many templates correspond to each? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY count(*) DESC LIMIT 1 | Which template type code has most number of templates? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY count(*) DESC LIMIT 1 | Return the type code of the template type that the most templates belong to. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code FROM Templates GROUP BY template_type_code HAVING count(*) < 3 | Show all template type codes with less than three templates. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code FROM Templates GROUP BY template_type_code HAVING count(*) < 3 | What are the codes of template types that have fewer than 3 templates? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT min(Version_Number) , template_type_code FROM Templates | What the smallest version number and its template type code? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT min(Version_Number) , template_type_code FROM Templates | Return the lowest version number, along with its corresponding template type code. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T2.document_name = "Data base" | What is the template type code of the template used by document with the name "Data base"? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T2.document_name = "Data base" | Return the template type code of the template that is used by a document named Data base. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T2.document_name FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T1.template_type_code = "BK" | Show all document names using templates with template type code BK. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T2.document_name FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T1.template_type_code = "BK" | What are the names of documents that use templates with the code BK? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.template_type_code , count(*) FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code | Show all template type codes and the number of documents using each type. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.template_type_code , count(*) FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code | What are the different template type codes, and how many documents use each type? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code ORDER BY count(*) DESC LIMIT 1 | Which template type code is used by most number of documents? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code ORDER BY count(*) DESC LIMIT 1 | Return the code of the template type that is most commonly used in documents. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code FROM Templates EXCEPT SELECT template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id | Show all template type codes that are not used by any document. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code FROM Templates EXCEPT SELECT template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id | What are the codes of template types that are not used for any document? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code , template_type_description FROM Ref_template_types | Show all template type codes and descriptions. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code , template_type_description FROM Ref_template_types | What are the type codes and descriptions for all template types? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_description FROM Ref_template_types WHERE template_type_code = "AD" | What is the template type descriptions for template type code "AD". | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_description FROM Ref_template_types WHERE template_type_code = "AD" | Return the template type description of the template type with the code AD. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code FROM Ref_template_types WHERE template_type_description = "Book" | What is the template type code for template type description "Book". | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT template_type_code FROM Ref_template_types WHERE template_type_description = "Book" | Return the type code of the template type with the description "Book". | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT DISTINCT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID = T3.template_ID | What are the distinct template type descriptions for the templates ever used by any document? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT DISTINCT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID = T3.template_ID | Return the different descriptions for templates that have been used in a document. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code WHERE T1.template_type_description = "Presentation" | What are the template ids with template type description "Presentation". | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code WHERE T1.template_type_description = "Presentation" | Return the ids corresponding to templates with the description 'Presentation'. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(*) FROM Paragraphs | How many paragraphs in total? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(*) FROM Paragraphs | Count the number of paragraphs. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID = T2.document_ID WHERE T2.document_name = 'Summer Show' | How many paragraphs for the document with name 'Summer Show'? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID = T2.document_ID WHERE T2.document_name = 'Summer Show' | Count the number of paragraphs in the document named 'Summer Show'. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
select other_details from paragraphs where paragraph_text like 'korea' | Show paragraph details for paragraph with text 'Korea ' . | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
select other_details from paragraphs where paragraph_text like 'korea' | What are the details for the paragraph that includes the text 'Korea ' ? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.paragraph_id , T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.Document_Name = 'Welcome to NY' | Show all paragraph ids and texts for the document with name 'Welcome to NY'. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.paragraph_id , T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.Document_Name = 'Welcome to NY' | What are the ids and texts of paragraphs in the document titled 'Welcome to NY'? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = "Customer reviews" | Show all paragraph texts for the document "Customer reviews". | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = "Customer reviews" | What are the paragraph texts for the document with the name 'Customer reviews'? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id , count(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id | Show all document ids and the number of paragraphs in each document. Order by document id. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id , count(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id | Return the different document ids along with the number of paragraphs corresponding to each, ordered by id. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.document_id , T2.document_name , count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id | Show all document ids, names and the number of paragraphs in each document. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.document_id , T2.document_name , count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id | What are the ids and names of each document, as well as the number of paragraphs in each? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) >= 2 | List all document ids with at least two paragraphs. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) >= 2 | What are the ids of documents that have 2 or more paragraphs? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.document_id , T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id ORDER BY count(*) DESC LIMIT 1 | What is the document id and name with greatest number of paragraphs? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT T1.document_id , T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id ORDER BY count(*) DESC LIMIT 1 | Return the id and name of the document with the most paragraphs. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1 | What is the document id with least number of paragraphs? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1 | Return the id of the document with the fewest paragraphs. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) BETWEEN 1 AND 2 | What is the document id with 1 to 2 paragraphs? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) BETWEEN 1 AND 2 | Give the ids of documents that have between one and two paragraphs. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Ireland' | Show the document id with paragraph text 'Brazil' and 'Ireland'. | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Ireland' | What are the ids of documents that contain the paragraph text 'Brazil' and 'Ireland'? | "Schema (values (type))": Ref_Template_Types : Template_Type_Code (text) , Template_Type_Description (text) | Templates : Template_ID (number) , Version_Number (number) , Template_Type_Code (text) , Date_Effective_From (time) , Date_Effective_To (time) , Template_Details (text) | Documents : Document_ID (number) , Template_ID (number) , Document_Name (text) , Document_Description (text) , Other_Details (text) | Paragraphs : Paragraph_ID (number) , Document_ID (number) , Paragraph_Text (text) , Other_Details (text)
"Primary Keys": Ref_Template_Types : Template_Type_Code | Templates : Template_ID | Documents : Document_ID | Paragraphs : Paragraph_ID
"Foreign Keys": Templates : Template_Type_Code equals Ref_Template_Types : Template_Type_Code | Documents : Template_ID equals Templates : Template_ID | Paragraphs : Document_ID equals Documents : Document_ID |
SELECT count(*) FROM teacher | How many teachers are there? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT count(*) FROM teacher | What is the total count of teachers? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Name FROM teacher ORDER BY Age ASC | List the names of teachers in ascending order of age. | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Name FROM teacher ORDER BY Age ASC | What are the names of the teachers ordered by ascending age? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Age , Hometown FROM teacher | What are the age and hometown of teachers? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Age , Hometown FROM teacher | What is the age and hometown of every teacher? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
select name from teacher where hometown != "little lever urban district" | List the name of teachers whose hometown is not `` Little Lever Urban District '' . | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
select name from teacher where hometown != "little lever urban district" | What are the names of the teachers whose hometown is not `` Little Lever Urban District '' ? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Name FROM teacher WHERE Age = 32 OR Age = 33 | Show the name of teachers aged either 32 or 33? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Name FROM teacher WHERE Age = 32 OR Age = 33 | What are the names of the teachers who are aged either 32 or 33? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Hometown FROM teacher ORDER BY Age ASC LIMIT 1 | What is the hometown of the youngest teacher? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Hometown FROM teacher ORDER BY Age ASC LIMIT 1 | Where is the youngest teacher from? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Hometown , COUNT(*) FROM teacher GROUP BY Hometown | Show different hometown of teachers and the number of teachers from each hometown. | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Hometown , COUNT(*) FROM teacher GROUP BY Hometown | For each hometown, how many teachers are there? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Hometown FROM teacher GROUP BY Hometown ORDER BY COUNT(*) DESC LIMIT 1 | List the most common hometown of teachers. | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Hometown FROM teacher GROUP BY Hometown ORDER BY COUNT(*) DESC LIMIT 1 | What is the most commmon hometowns for teachers? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Hometown FROM teacher GROUP BY Hometown HAVING COUNT(*) >= 2 | Show the hometowns shared by at least two teachers. | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT Hometown FROM teacher GROUP BY Hometown HAVING COUNT(*) >= 2 | What are the towns from which at least two teachers come from? | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |
SELECT T3.Name , T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID | Show names of teachers and the courses they are arranged to teach. | "Schema (values (type))": course : Course_ID (number) , Staring_Date (text) , Course (text) | teacher : Teacher_ID (number) , Name (text) , Age (text) , Hometown (text) | course_arrange : Course_ID (number) , Teacher_ID (number) , Grade (number)
"Primary Keys": course : Course_ID | teacher : Teacher_ID | course_arrange : Course_ID
"Foreign Keys": course_arrange : Teacher_ID equals teacher : Teacher_ID | course_arrange : Course_ID equals course : Course_ID |