target-benchmark/spider-queries huggingface dataset:
Database: cre_Doc_Template_Mgt (tables: documents)
Question: Show all template ids and number of documents using each template.
SQL: SELECT template_id ,  count(*) FROM Documents GROUP BY template_id
Database: cre_Doc_Template_Mgt (tables: documents)
Question: What are all different template ids used for documents, and how many times were each of them used?
SQL: SELECT template_id ,  count(*) FROM Documents GROUP BY template_id
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: What is the id and type code for the template used by the most documents?
SQL: 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
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: Return the id and type code of the template that is used for the greatest number of documents.
SQL: 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
Database: cre_Doc_Template_Mgt (tables: documents)
Question: Show ids for all templates that are used by more than one document.
SQL: SELECT template_id FROM Documents GROUP BY template_id HAVING count(*)  >  1
Database: cre_Doc_Template_Mgt (tables: documents)
Question: What are the template ids of any templates used in more than a single document?
SQL: SELECT template_id FROM Documents GROUP BY template_id HAVING count(*)  >  1
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: Show ids for all templates not used by any document.
SQL: SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: What are the ids for templates that are not used in any documents?
SQL: SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents
Database: cre_Doc_Template_Mgt (tables: templates)
Question: How many templates do we have?
SQL: SELECT count(*) FROM Templates
Database: cre_Doc_Template_Mgt (tables: templates)
Question: Count the number of templates.
SQL: SELECT count(*) FROM Templates
Database: cre_Doc_Template_Mgt (tables: templates)
Question: Show template ids, version numbers, and template type codes for all templates.
SQL: SELECT template_id ,  version_number ,  template_type_code FROM Templates
Database: cre_Doc_Template_Mgt (tables: templates)
Question: What are the ids, version numbers, and type codes for each template?
SQL: SELECT template_id ,  version_number ,  template_type_code FROM Templates
Database: cre_Doc_Template_Mgt (tables: templates)
Question: Show all distinct template type codes for all templates.
SQL: SELECT DISTINCT template_type_code FROM Templates
Database: cre_Doc_Template_Mgt (tables: templates)
Question: What are the different template type codes?
SQL: SELECT DISTINCT template_type_code FROM Templates
Database: cre_Doc_Template_Mgt (tables: templates)
Question: What are the ids of templates with template type code PP or PPT?
SQL: SELECT template_id FROM Templates WHERE template_type_code  =  "PP" OR template_type_code  =  "PPT"
Database: cre_Doc_Template_Mgt (tables: templates)
Question: Return the ids of templates that have the code PP or PPT.
SQL: SELECT template_id FROM Templates WHERE template_type_code  =  "PP" OR template_type_code  =  "PPT"
Database: cre_Doc_Template_Mgt (tables: templates)
Question: How many templates have template type code CV?
SQL: SELECT count(*) FROM Templates WHERE template_type_code  =  "CV"
Database: cre_Doc_Template_Mgt (tables: templates)
Question: Count the number of templates of the type CV.
SQL: SELECT count(*) FROM Templates WHERE template_type_code  =  "CV"
Database: cre_Doc_Template_Mgt (tables: templates)
Question: What is the version number and template type code for the template with version number later than 5?
SQL: SELECT version_number ,  template_type_code FROM Templates WHERE version_number  >  5
Database: cre_Doc_Template_Mgt (tables: templates)
Question: Return the version numbers and template type codes of templates with a version number greater than 5.
SQL: SELECT version_number ,  template_type_code FROM Templates WHERE version_number  >  5
Database: cre_Doc_Template_Mgt (tables: templates)
Question: Show all template type codes and number of templates for each.
SQL: SELECT template_type_code ,  count(*) FROM Templates GROUP BY template_type_code
Database: cre_Doc_Template_Mgt (tables: templates)
Question: What are the different template type codes, and how many templates correspond to each?
SQL: SELECT template_type_code ,  count(*) FROM Templates GROUP BY template_type_code
Database: cre_Doc_Template_Mgt (tables: templates)
Question: Which template type code has most number of templates?
SQL: SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY count(*) DESC LIMIT 1
Database: cre_Doc_Template_Mgt (tables: templates)
Question: Return the type code of the template type that the most templates belong to.
SQL: SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY count(*) DESC LIMIT 1
Database: cre_Doc_Template_Mgt (tables: templates)
Question: Show all template type codes with less than three templates.
SQL: SELECT template_type_code FROM Templates GROUP BY template_type_code HAVING count(*)  <  3
Database: cre_Doc_Template_Mgt (tables: templates)
Question: What are the codes of template types that have fewer than 3 templates?
SQL: SELECT template_type_code FROM Templates GROUP BY template_type_code HAVING count(*)  <  3
Database: cre_Doc_Template_Mgt (tables: templates)
Question: What the smallest version number and its template type code?
SQL: SELECT min(Version_Number) ,  template_type_code FROM Templates
Database: cre_Doc_Template_Mgt (tables: templates)
Question: Return the lowest version number, along with its corresponding template type code.
SQL: SELECT min(Version_Number) ,  template_type_code FROM Templates
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: What is the template type code of the template used by document with the name "Data base"?
SQL: 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"
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: Return the template type code of the template that is used by a document named Data base.
SQL: 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"
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: Show all document names using templates with template type code BK.
SQL: 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"
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: What are the names of documents that use templates with the code BK?
SQL: 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"
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: Show all template type codes and the number of documents using each type.
SQL: 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
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: What are the different template type codes, and how many documents use each type?
SQL: 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
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: Which template type code is used by most number of documents?
SQL: 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
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: Return the code of the template type that is most commonly used in documents.
SQL: 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
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: Show all template type codes that are not used by any document.
SQL: 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
Database: cre_Doc_Template_Mgt (tables: documents, templates)
Question: What are the codes of template types that are not used for any document?
SQL: 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
Database: cre_Doc_Template_Mgt (tables: ref_template_types)
Question: Show all template type codes and descriptions.
SQL: SELECT template_type_code ,  template_type_description FROM Ref_template_types
Database: cre_Doc_Template_Mgt (tables: ref_template_types)
Question: What are the type codes and descriptions for all template types?
SQL: SELECT template_type_code ,  template_type_description FROM Ref_template_types
Database: cre_Doc_Template_Mgt (tables: ref_template_types)
Question: What is the template type descriptions for template type code "AD".
SQL: SELECT template_type_description FROM Ref_template_types WHERE template_type_code  =  "AD"
Database: cre_Doc_Template_Mgt (tables: ref_template_types)
Question: Return the template type description of the template type with the code AD.
SQL: SELECT template_type_description FROM Ref_template_types WHERE template_type_code  =  "AD"
Database: cre_Doc_Template_Mgt (tables: ref_template_types)
Question: What is the template type code for template type description "Book".
SQL: SELECT template_type_code FROM Ref_template_types WHERE template_type_description  =  "Book"
Database: cre_Doc_Template_Mgt (tables: ref_template_types)
Question: Return the type code of the template type with the description "Book".
SQL: SELECT template_type_code FROM Ref_template_types WHERE template_type_description  =  "Book"
Database: cre_Doc_Template_Mgt (tables: documents, templates, ref_template_types)
Question: What are the distinct template type descriptions for the templates ever used by any document?
SQL: 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
Database: cre_Doc_Template_Mgt (tables: documents, templates, ref_template_types)
Question: Return the different descriptions for templates that have been used in a document.
SQL: 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
Database: cre_Doc_Template_Mgt (tables: templates, ref_template_types)
Question: What are the template ids with template type description "Presentation".
SQL: 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"
Database: cre_Doc_Template_Mgt (tables: templates, ref_template_types)
Question: Return the ids corresponding to templates with the description 'Presentation'.
SQL: 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"
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: How many paragraphs in total?
SQL: SELECT count(*) FROM Paragraphs
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: Count the number of paragraphs.
SQL: SELECT count(*) FROM Paragraphs
Database: cre_Doc_Template_Mgt (tables: paragraphs, documents)
Question: How many paragraphs for the document with name 'Summer Show'?
SQL: SELECT count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID  =  T2.document_ID WHERE T2.document_name  =  'Summer Show'
Database: cre_Doc_Template_Mgt (tables: paragraphs, documents)
Question: Count the number of paragraphs in the document named 'Summer Show'.
SQL: SELECT count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID  =  T2.document_ID WHERE T2.document_name  =  'Summer Show'
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: Show paragraph details for paragraph with text 'Korea ' .
SQL: select other_details from paragraphs where paragraph_text like 'korea'
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: What are the details for the paragraph that includes the text 'Korea ' ?
SQL: select other_details from paragraphs where paragraph_text like 'korea'
Database: cre_Doc_Template_Mgt (tables: paragraphs, documents)
Question: Show all paragraph ids and texts for the document with name 'Welcome to NY'.
SQL: 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'
Database: cre_Doc_Template_Mgt (tables: paragraphs, documents)
Question: What are the ids and texts of paragraphs in the document titled 'Welcome to NY'?
SQL: 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'
Database: cre_Doc_Template_Mgt (tables: paragraphs, documents)
Question: Show all paragraph texts for the document "Customer reviews".
SQL: 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"
Database: cre_Doc_Template_Mgt (tables: paragraphs, documents)
Question: What are the paragraph texts for the document with the name 'Customer reviews'?
SQL: 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"
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: Show all document ids and the number of paragraphs in each document. Order by document id.
SQL: SELECT document_id ,  count(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: Return the different document ids along with the number of paragraphs corresponding to each, ordered by id.
SQL: SELECT document_id ,  count(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id
Database: cre_Doc_Template_Mgt (tables: paragraphs, documents)
Question: Show all document ids, names and the number of paragraphs in each document.
SQL: 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
Database: cre_Doc_Template_Mgt (tables: paragraphs, documents)
Question: What are the ids and names of each document, as well as the number of paragraphs in each?
SQL: 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
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: List all document ids with at least two paragraphs.
SQL: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*)  >=  2
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: What are the ids of documents that have 2 or more paragraphs?
SQL: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*)  >=  2
Database: cre_Doc_Template_Mgt (tables: paragraphs, documents)
Question: What is the document id and name with greatest number of paragraphs?
SQL: 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
Database: cre_Doc_Template_Mgt (tables: paragraphs, documents)
Question: Return the id and name of the document with the most paragraphs.
SQL: 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
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: What is the document id with least number of paragraphs?
SQL: SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: Return the id of the document with the fewest paragraphs.
SQL: SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: What is the document id with 1 to 2 paragraphs?
SQL: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) BETWEEN 1 AND 2
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: Give the ids of documents that have between one and two paragraphs.
SQL: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) BETWEEN 1 AND 2
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: Show the document id with paragraph text 'Brazil' and 'Ireland'.
SQL: SELECT document_id FROM Paragraphs WHERE paragraph_text  =  'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text  =  'Ireland'
Database: cre_Doc_Template_Mgt (tables: paragraphs)
Question: What are the ids of documents that contain the paragraph text 'Brazil' and 'Ireland'?
SQL: SELECT document_id FROM Paragraphs WHERE paragraph_text  =  'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text  =  'Ireland'
Database: course_teach (tables: teacher)
Question: How many teachers are there?
SQL: SELECT count(*) FROM teacher
Database: course_teach (tables: teacher)
Question: What is the total count of teachers?
SQL: SELECT count(*) FROM teacher
Database: course_teach (tables: teacher)
Question: List the names of teachers in ascending order of age.
SQL: SELECT Name FROM teacher ORDER BY Age ASC
Database: course_teach (tables: teacher)
Question: What are the names of the teachers ordered by ascending age?
SQL: SELECT Name FROM teacher ORDER BY Age ASC
Database: course_teach (tables: teacher)
Question: What are the age and hometown of teachers?
SQL: SELECT Age ,  Hometown FROM teacher
Database: course_teach (tables: teacher)
Question: What is the age and hometown of every teacher?
SQL: SELECT Age ,  Hometown FROM teacher
Database: course_teach (tables: teacher)
Question: List the name of teachers whose hometown is not `` Little Lever Urban District '' .
SQL: select name from teacher where hometown != "little lever urban district"
Database: course_teach (tables: teacher)
Question: What are the names of the teachers whose hometown is not `` Little Lever Urban District '' ?
SQL: select name from teacher where hometown != "little lever urban district"
Database: course_teach (tables: teacher)
Question: Show the name of teachers aged either 32 or 33?
SQL: SELECT Name FROM teacher WHERE Age  =  32 OR Age  =  33
Database: course_teach (tables: teacher)
Question: What are the names of the teachers who are aged either 32 or 33?
SQL: SELECT Name FROM teacher WHERE Age  =  32 OR Age  =  33
Database: course_teach (tables: teacher)
Question: What is the hometown of the youngest teacher?
SQL: SELECT Hometown FROM teacher ORDER BY Age ASC LIMIT 1
Database: course_teach (tables: teacher)
Question: Where is the youngest teacher from?
SQL: SELECT Hometown FROM teacher ORDER BY Age ASC LIMIT 1
Database: course_teach (tables: teacher)
Question: Show different hometown of teachers and the number of teachers from each hometown.
SQL: SELECT Hometown ,  COUNT(*) FROM teacher GROUP BY Hometown
Database: course_teach (tables: teacher)
Question: For each hometown, how many teachers are there?
SQL: SELECT Hometown ,  COUNT(*) FROM teacher GROUP BY Hometown
Database: course_teach (tables: teacher)
Question: List the most common hometown of teachers.
SQL: SELECT Hometown FROM teacher GROUP BY Hometown ORDER BY COUNT(*) DESC LIMIT 1
Database: course_teach (tables: teacher)
Question: What is the most commmon hometowns for teachers?
SQL: SELECT Hometown FROM teacher GROUP BY Hometown ORDER BY COUNT(*) DESC LIMIT 1
Database: course_teach (tables: teacher)
Question: Show the hometowns shared by at least two teachers.
SQL: SELECT Hometown FROM teacher GROUP BY Hometown HAVING COUNT(*)  >=  2
Database: course_teach (tables: teacher)
Question: What are the towns from which at least two teachers come from?
SQL: SELECT Hometown FROM teacher GROUP BY Hometown HAVING COUNT(*)  >=  2
Database: course_teach (tables: teacher, course, course_arrange)
Question: Show names of teachers and the courses they are arranged to teach.
SQL: 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
Database: course_teach (tables: teacher, course, course_arrange)
Question: What is the name of each teacher and what course they teach?
SQL: 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
Database: course_teach (tables: teacher, course, course_arrange)
Question: Show names of teachers and the courses they are arranged to teach in ascending alphabetical order of the teacher's name.
SQL: 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 ORDER BY T3.Name
Database: course_teach (tables: teacher, course, course_arrange)
Question: What are the names of the teachers and the courses they teach in ascending alphabetical order by the name of the teacher?
SQL: 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 ORDER BY T3.Name
Database: course_teach (tables: teacher, course, course_arrange)
Question: Show the name of the teacher for the math course.
SQL: SELECT T3.Name 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 WHERE T2.Course  =  "Math"
Database: course_teach (tables: teacher, course, course_arrange)
Question: What are the names of the people who teach math courses?
SQL: SELECT T3.Name 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 WHERE T2.Course  =  "Math"
Database: course_teach (tables: teacher, course_arrange)
Question: Show names of teachers and the number of courses they teach.
SQL: SELECT T2.Name ,  COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name
Database: course_teach (tables: teacher, course_arrange)
Question: What are the names of the teachers and how many courses do they teach?
SQL: SELECT T2.Name ,  COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name
Database: course_teach (tables: teacher, course_arrange)
Question: Show names of teachers that teach at least two courses.
SQL: SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2
Database: course_teach (tables: teacher, course_arrange)
Question: What are the names of the teachers who teach at least two courses?
SQL: SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2
Database: course_teach (tables: teacher, course_arrange)
Question: List the names of teachers who have not been arranged to teach courses.
SQL: SELECT Name FROM teacher WHERE Teacher_id NOT IN (SELECT Teacher_id FROM course_arrange)