Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Which grade is studying in room 105? [/INST]

Output: SELECT DISTINCT grade FROM list WHERE classroom  =  105;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Which classrooms are used by grade 4? [/INST]

Output: SELECT DISTINCT classroom FROM list WHERE grade  =  4;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the classrooms in which grade 4 is studying. [/INST]

Output: SELECT DISTINCT classroom FROM list WHERE grade  =  4;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Which classrooms are used by grade 5? [/INST]

Output: SELECT DISTINCT classroom FROM list WHERE grade  =  5;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Show me the classrooms grade 5 is using. [/INST]

Output: SELECT DISTINCT classroom FROM list WHERE grade  =  5;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the last names of the teachers that teach fifth grade. [/INST]

Output: SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE grade  =  5;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: what are the last names of the teachers who teach grade 5? [/INST]

Output: SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE grade  =  5;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the first names of the teachers that teach first grade. [/INST]

Output: SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE grade  =  1;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: What are the first names of the teachers who teach grade 1? [/INST]

Output: SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE grade  =  1;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the first names of all the teachers that teach in classroom 110. [/INST]

Output: SELECT firstname FROM teachers WHERE classroom  =  110;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Which teachers teach in classroom 110? Give me their first names. [/INST]

Output: SELECT firstname FROM teachers WHERE classroom  =  110;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the last names of teachers teaching in classroom 109. [/INST]

Output: SELECT lastname FROM teachers WHERE classroom  =  109;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Which teachers teach in classroom 109? Give me their last names. [/INST]

Output: SELECT lastname FROM teachers WHERE classroom  =  109;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Report the first name and last name of all the teachers. [/INST]

Output: SELECT DISTINCT firstname ,  lastname FROM teachers;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: What are the first name and last name of all the teachers? [/INST]

Output: SELECT DISTINCT firstname ,  lastname FROM teachers;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Report the first name and last name of all the students. [/INST]

Output: SELECT DISTINCT firstname ,  lastname FROM list;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Show each student's first name and last name. [/INST]

Output: SELECT DISTINCT firstname ,  lastname FROM list;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find all students taught by OTHA MOYER. Output the first and last names of the students. [/INST]

Output: SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "OTHA" AND T2.lastname  =  "MOYER";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Which students study under the teacher named OTHA MOYER? Give me the first and last names of the students. [/INST]

Output: SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "OTHA" AND T2.lastname  =  "MOYER";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find all students taught by MARROTTE KIRK. Output first and last names of students. [/INST]

Output: SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "MARROTTE" AND T2.lastname  =  "KIRK";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Which are the first and last names of the students taught by MARROTTE KIRK? [/INST]

Output: SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "MARROTTE" AND T2.lastname  =  "KIRK";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the first and last name of all the teachers that teach EVELINA BROMLEY. [/INST]

Output: SELECT T2.firstname ,  T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "EVELINA" AND T1.lastname  =  "BROMLEY";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Which teachers teach the student named EVELINA BROMLEY? Give me the first and last name  of the teachers. [/INST]

Output: SELECT T2.firstname ,  T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "EVELINA" AND T1.lastname  =  "BROMLEY";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the last names of all the teachers that teach GELL TAMI. [/INST]

Output: SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "GELL" AND T1.lastname  =  "TAMI";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: What are the last names of the teachers who teach the student called GELL TAMI? [/INST]

Output: SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "GELL" AND T1.lastname  =  "TAMI";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: How many students does LORIA ONDERSMA teaches? [/INST]

Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "LORIA" AND T2.lastname  =  "ONDERSMA";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Count the number of students the teacher LORIA ONDERSMA teaches. [/INST]

Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "LORIA" AND T2.lastname  =  "ONDERSMA";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: How many students does KAWA GORDON teaches? [/INST]

Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "KAWA" AND T2.lastname  =  "GORDON";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the number of students taught by the teacher KAWA GORDON. [/INST]

Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "KAWA" AND T2.lastname  =  "GORDON";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the number of students taught by TARRING LEIA. [/INST]

Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "TARRING" AND T2.lastname  =  "LEIA";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: How many students are taught by teacher TARRING LEIA? [/INST]

Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "TARRING" AND T2.lastname  =  "LEIA";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: How many teachers does the student named CHRISSY NABOZNY have? [/INST]

Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "CHRISSY" AND T1.lastname  =  "NABOZNY";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the number of teachers who teach the student called CHRISSY NABOZNY. [/INST]

Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "CHRISSY" AND T1.lastname  =  "NABOZNY";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: How many teachers does the student named MADLOCK RAY have? [/INST]

Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "MADLOCK" AND T1.lastname  =  "RAY";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the number of teachers who teach the student called MADLOCK RAY. [/INST]

Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "MADLOCK" AND T1.lastname  =  "RAY";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names. [/INST]

Output: SELECT DISTINCT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.grade  =  1 EXCEPT SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "OTHA" AND T2.lastname  =  "MOYER";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: What are the first and last names of the first-grade students who are NOT taught by teacher OTHA MOYER? [/INST]

Output: SELECT DISTINCT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.grade  =  1 EXCEPT SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "OTHA" AND T2.lastname  =  "MOYER";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the last names of the students in third grade that are not taught by COVIN JEROME. [/INST]

Output: SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.grade  =  3 AND T2.firstname != "COVIN" AND T2.lastname != "JEROME";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Which students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students. [/INST]

Output: SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.grade  =  3 AND T2.firstname != "COVIN" AND T2.lastname != "JEROME";


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade. [/INST]

Output: SELECT grade ,  count(DISTINCT classroom) ,  count(*) FROM list GROUP BY grade;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: For each grade, return the grade number, the number of classrooms used for the grade, and the total number of students enrolled in the grade. [/INST]

Output: SELECT grade ,  count(DISTINCT classroom) ,  count(*) FROM list GROUP BY grade;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: For each classroom, report the classroom number and the number of grades using it. [/INST]

Output: SELECT classroom ,  count(DISTINCT grade) FROM list GROUP BY classroom;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: For each classroom, show the classroom number and count the number of distinct grades that use the room. [/INST]

Output: SELECT classroom ,  count(DISTINCT grade) FROM list GROUP BY classroom;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Which classroom has the most students? [/INST]

Output: SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the classroom that the most students use. [/INST]

Output: SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Report the number of students in each classroom. [/INST]

Output: SELECT classroom ,  count(*) FROM list GROUP BY classroom;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: For each classroom, show the classroom number and find how many students are using it. [/INST]

Output: SELECT classroom ,  count(*) FROM list GROUP BY classroom;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: For each grade 0 classroom, report the total number of students. [/INST]

Output: SELECT classroom ,  count(*) FROM list WHERE grade  =  "0" GROUP BY classroom;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: For each grade 0 classroom, return the classroom number and the count of students. [/INST]

Output: SELECT classroom ,  count(*) FROM list WHERE grade  =  "0" GROUP BY classroom;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Report the total number of students for each fourth-grade classroom. [/INST]

Output: SELECT classroom ,  count(*) FROM list WHERE grade  =  "4" GROUP BY classroom;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: For each fourth-grade classroom, show the classroom number and the total number of students using it. [/INST]

Output: SELECT classroom ,  count(*) FROM list WHERE grade  =  "4" GROUP BY classroom;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the name of the teacher who teaches the largest number of students. [/INST]

Output: SELECT T2.firstname ,  T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom GROUP BY T2.firstname ,  T2.lastname ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Which teacher teaches the most students? Give me the first name and last name of the teacher. [/INST]

Output: SELECT T2.firstname ,  T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom GROUP BY T2.firstname ,  T2.lastname ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: Find the number of students in one classroom. [/INST]

Output: SELECT count(*) ,  classroom FROM list GROUP BY classroom;


Input:
[INST] Here is a database schema:
list :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Grade [ INT ]
Classroom [ INT ]

teachers :
LastName [ TEXT ] primary_key
FirstName [ TEXT ]
Classroom [ INT ]

Please write me a SQL statement that answers the following question: How many students does one classroom have? [/INST]

Output: SELECT count(*) ,  classroom FROM list GROUP BY classroom;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: How many companies are headquartered in the US? [/INST]

Output: SELECT count(*) FROM company WHERE Headquarters  =  'USA';


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: List the names of companies by ascending number of sales. [/INST]

Output: SELECT Name FROM company ORDER BY Sales_in_Billion ASC;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: What are the headquarters and industries of all companies? [/INST]

Output: SELECT Headquarters ,  Industry FROM company;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: Show the names of companies in the banking or retailing industry? [/INST]

Output: SELECT Name FROM company WHERE Industry  =  "Banking" OR Industry  =  "Retailing";


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: What is the maximum and minimum market value of companies? [/INST]

Output: SELECT max(Market_Value_in_Billion) ,  min(Market_Value_in_Billion) FROM company;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: What is the headquarter of the company with the largest sales? [/INST]

Output: SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: Show the different headquarters and number of companies at each headquarter. [/INST]

Output: SELECT Headquarters ,  COUNT(*) FROM company GROUP BY Headquarters;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: Show the most common headquarter for companies. [/INST]

Output: SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: Show the headquarters that have at least two companies. [/INST]

Output: SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*)  >=  2;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: Show the headquarters that have both companies in banking industry and companies in oil and gas industry. [/INST]

Output: SELECT Headquarters FROM company WHERE Industry  =  "Banking" INTERSECT SELECT Headquarters FROM company WHERE Industry  =  "Oil and gas";


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: Show the names of companies and of employees. [/INST]

Output: SELECT T3.Name ,  T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: Show names of companies and that of employees in descending order of number of years working for that employee. [/INST]

Output: SELECT T3.Name ,  T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID ORDER BY T1.Year_working;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: Show the names of employees that work for companies with sales bigger than 200. [/INST]

Output: SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID WHERE T3.Sales_in_Billion  >  200;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: Show the names of companies and the number of employees they have [/INST]

Output: SELECT T3.Name ,  COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID GROUP BY T3.Name;


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: List the names of people that are not employed by any company [/INST]

Output: SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM employment);


Input:
[INST] Here is a database schema:
people :
People_ID [ INT ] primary_key
Age [ INT ]
Name [ TEXT ]
Nationality [ TEXT ]
Graduation_College [ TEXT ]

company :
Company_ID [ INT ] primary_key
Name [ TEXT ]
Headquarters [ TEXT ]
Industry [ TEXT ]
Sales_in_Billion [ INT ]
Profits_in_Billion [ INT ]
Assets_in_Billion [ INT ]
Market_Value_in_Billion [ INT ]

employment :
Company_ID [ INT ] primary_key employment.Company_ID = company.Company_ID
People_ID [ INT ] employment.People_ID = people.People_ID
Year_working [ INT ]

Please write me a SQL statement that answers the following question: list the names of the companies with more than 200 sales in the descending order of sales and profits. [/INST]

Output: SELECT name FROM company WHERE Sales_in_Billion  >  200 ORDER BY Sales_in_Billion ,  Profits_in_Billion DESC;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: How many film are there? [/INST]

Output: SELECT count(*) FROM film;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Count the number of films. [/INST]

Output: SELECT count(*) FROM film;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: List the distinct director of all films. [/INST]

Output: SELECT DISTINCT Director FROM film;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the different film Directors? [/INST]

Output: SELECT DISTINCT Director FROM film;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What is the average ticket sales gross in dollars of films? [/INST]

Output: SELECT avg(Gross_in_dollar) FROM film;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Return the average gross sales in dollars across all films. [/INST]

Output: SELECT avg(Gross_in_dollar) FROM film;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the low and high estimates of film markets? [/INST]

Output: SELECT Low_Estimate ,  High_Estimate FROM film_market_estimation;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Return the low and high estimates for all film markets. [/INST]

Output: SELECT Low_Estimate ,  High_Estimate FROM film_market_estimation;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the types of film market estimations in year 1995? [/INST]

Output: SELECT TYPE FROM film_market_estimation WHERE YEAR  =  1995;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Return the types of film market estimations in 1995. [/INST]

Output: SELECT TYPE FROM film_market_estimation WHERE YEAR  =  1995;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the maximum and minimum number of cities in all markets. [/INST]

Output: SELECT max(Number_cities) ,  min(Number_cities) FROM market;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Return the maximum and minimum number of cities across all markets. [/INST]

Output: SELECT max(Number_cities) ,  min(Number_cities) FROM market;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: How many markets have number of cities smaller than 300? [/INST]

Output: SELECT count(*) FROM market WHERE Number_cities  <  300;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Count the number of markets that have a number of cities lower than 300. [/INST]

Output: SELECT count(*) FROM market WHERE Number_cities  <  300;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: List all countries of markets in ascending alphabetical order. [/INST]

Output: SELECT Country FROM market ORDER BY Country ASC;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the countries for each market, ordered alphabetically? [/INST]

Output: SELECT Country FROM market ORDER BY Country ASC;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: List all countries of markets in descending order of number of cities. [/INST]

Output: SELECT Country FROM market ORDER BY Number_cities DESC;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the countries for each market ordered by decreasing number of cities? [/INST]

Output: SELECT Country FROM market ORDER BY Number_cities DESC;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Please show the titles of films and the types of market estimations. [/INST]

Output: SELECT T1.Title ,  T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID  =  T2.Film_ID;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the titles of films and corresponding types of market estimations? [/INST]

Output: SELECT T1.Title ,  T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID  =  T2.Film_ID;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Show the distinct director of films with market estimation in the year of 1995. [/INST]

Output: SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID  =  T2.Film_ID WHERE T2.Year  =  1995;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Who are the different directors of films which had market estimation in 1995? [/INST]

Output: SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID  =  T2.Film_ID WHERE T2.Year  =  1995;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What is the average number of cities of markets with low film market estimate bigger than 10000? [/INST]

Output: SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID WHERE T1.Low_Estimate  >  10000;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Give the average number of cities within markets that had a low market estimation larger than 10000? [/INST]

Output: SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID WHERE T1.Low_Estimate  >  10000;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Please list the countries and years of film market estimations. [/INST]

Output: SELECT T2.Country ,  T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the countries of markets and their corresponding years of market estimation? [/INST]

Output: SELECT T2.Country ,  T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Please list the years of film market estimations when the market is in country "Japan" in descending order. [/INST]

Output: SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID WHERE T2.Country  =  "Japan" ORDER BY T1.Year DESC;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the years of film market estimation for the market of Japan, ordered by year descending? [/INST]

Output: SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID WHERE T2.Country  =  "Japan" ORDER BY T1.Year DESC;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: List the studios of each film and the number of films produced by that studio. [/INST]

Output: SELECT Studio ,  COUNT(*) FROM film GROUP BY Studio;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: How films are produced by each studio? [/INST]

Output: SELECT Studio ,  COUNT(*) FROM film GROUP BY Studio;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: List the name of film studio that have the most number of films. [/INST]

Output: SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What is the name of teh studio that created the most films? [/INST]

Output: SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: List the names of studios that have at least two films. [/INST]

Output: SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*)  >=  2;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the names of studios that have made two or more films? [/INST]

Output: SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*)  >=  2;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: List the title of films that do not have any market estimation. [/INST]

Output: SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation);


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the titles of films that do not have a film market estimation? [/INST]

Output: SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation);


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Show the studios that have produced films with director "Nicholas Meyer" and "Walter Hill". [/INST]

Output: SELECT Studio FROM film WHERE Director  =  "Nicholas Meyer" INTERSECT SELECT Studio FROM film WHERE Director  =  "Walter Hill";


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the names of studios that have produced films with both Nicholas Meyer and Walter Hill? [/INST]

Output: SELECT Studio FROM film WHERE Director  =  "Nicholas Meyer" INTERSECT SELECT Studio FROM film WHERE Director  =  "Walter Hill";


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Find the titles and studios of the films that are produced by some film studios that contained the word "Universal". [/INST]

Output: SELECT title ,  Studio FROM film WHERE Studio LIKE "%Universal%";


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the titles and studios of films that have been produced by a studio whose name contains "Universal"? [/INST]

Output: SELECT title ,  Studio FROM film WHERE Studio LIKE "%Universal%";


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Show the studios that have not produced films with director "Walter Hill". [/INST]

Output: SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director  =  "Walter Hill";


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Which studios have never worked with the director Walter Hill? [/INST]

Output: SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director  =  "Walter Hill";


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: List the studios which average gross is above 4500000. [/INST]

Output: SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar)  >=  4500000;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Which studios have an average gross of over 4500000? [/INST]

Output: SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar)  >=  4500000;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What is the title of the film that has the highest high market estimation. [/INST]

Output: SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2  ON T1.Film_ID  =  T2.Film_ID ORDER BY high_estimate DESC LIMIT 1;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Return the title of the film with the highest high estimate? [/INST]

Output: SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2  ON T1.Film_ID  =  T2.Film_ID ORDER BY high_estimate DESC LIMIT 1;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: What are the titles and directors of the films were never presented in China? [/INST]

Output: SELECT title ,  director FROM film WHERE film_id NOT IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id  =  T2.Market_ID WHERE country  =  'China');


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Title [ TEXT ]
Studio [ TEXT ]
Director [ TEXT ]
Gross_in_dollar [ INT ]

market :
Market_ID [ INT ] primary_key
Country [ TEXT ]
Number_cities [ INT ]

film_market_estimation :
Estimation_ID [ INT ] primary_key
Low_Estimate [ INT ]
High_Estimate [ INT ]
Film_ID [ INT ] film_market_estimation.Film_ID = film.Film_ID
Type [ TEXT ]
Market_ID [ INT ] film_market_estimation.Market_ID = market.Market_ID
Year [ INT ]

Please write me a SQL statement that answers the following question: Return the titles and directors of films that were never in the market of China. [/INST]

Output: SELECT title ,  director FROM film WHERE film_id NOT IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id  =  T2.Market_ID WHERE country  =  'China');


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: How many calendar items do we have? [/INST]

Output: SELECT count(*) FROM Ref_calendar;


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Count the number of all the calendar items. [/INST]

Output: SELECT count(*) FROM Ref_calendar;


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Show all calendar dates and day Numbers. [/INST]

Output: SELECT calendar_date ,  day_Number FROM Ref_calendar;


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What are all the calendar dates and day Numbers? [/INST]

Output: SELECT calendar_date ,  day_Number FROM Ref_calendar;


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Show the number of document types. [/INST]

Output: SELECT count(*) FROM Ref_document_types;


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: How many document types are there? [/INST]

Output: SELECT count(*) FROM Ref_document_types;


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: List all document type codes and document type names. [/INST]

Output: SELECT document_type_code ,  document_type_name FROM Ref_document_types;


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What are all the document type codes and document type names? [/INST]

Output: SELECT document_type_code ,  document_type_name FROM Ref_document_types;


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name and description for document type code RV? [/INST]

Output: SELECT document_type_name ,  document_type_description FROM Ref_document_types WHERE document_type_code  =  "RV";


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Give me the name and description of the document type code RV. [/INST]

Output: SELECT document_type_name ,  document_type_description FROM Ref_document_types WHERE document_type_code  =  "RV";


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What is the document type code for document type "Paper"? [/INST]

Output: SELECT document_type_code FROM Ref_document_types WHERE document_type_name  =  "Paper";


Input:
[INST] Here is a database schema:
Ref_Document_Types :
Document_Type_Code [ TEXT ] primary_key
Document_Type_Name [ TEXT ]
Document_Type_Description [ TEXT ]

Ref_Calendar :
Calendar_Date [ TEXT ] primary_key
Day_Number [ INT ]

Ref_Locations :
Location_Code [ TEXT ] primary_key
Location_Name [ TEXT ]
Location_Description [ TEXT ]

Roles :
Role_Code [ TEXT ] primary_key
Role_Name [ TEXT ]
Role_Description [ TEXT ]

All_Documents :
Document_ID [ INT ] primary_key
Date_Stored [ TEXT ] All_Documents.Date_Stored = Ref_Calendar.Calendar_Date
Document_Type_Code [ TEXT ] All_Documents.Document_Type_Code = Ref_Document_Types.Document_Type_Code
Document_Name [ TEXT ]
Document_Description [ TEXT ]
Other_Details [ TEXT ]

Employees :
Employee_ID [ INT ] primary_key
Role_Code [ TEXT ] Employees.Role_Code = Roles.Role_Code
Employee_Name [ TEXT ]
Gender_MFU [ TEXT ]
Date_of_Birth [ TEXT ]
Other_Details [ TEXT ]

Document_Locations :
Document_ID [ INT ] primary_key Document_Locations.Document_ID = All_Documents.Document_ID
Location_Code [ TEXT ] Document_Locations.Location_Code = Ref_Locations.Location_Code
Date_in_Location_From [ TEXT ] Document_Locations.Date_in_Location_From = Ref_Calendar.Calendar_Date
Date_in_Locaton_To [ TEXT ] Document_Locations.Date_in_Locaton_To = Ref_Calendar.Calendar_Date

Documents_to_be_Destroyed :
Document_ID [ INT ] primary_key Documents_to_be_Destroyed.Document_ID = All_Documents.Document_ID
Destruction_Authorised_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID = Employees.Employee_ID
Destroyed_by_Employee_ID [ INT ] Documents_to_be_Destroyed.Destroyed_by_Employee_ID = Employees.Employee_ID
Planned_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Planned_Destruction_Date = Ref_Calendar.Calendar_Date
Actual_Destruction_Date [ TEXT ] Documents_to_be_Destroyed.Actual_Destruction_Date = Ref_Calendar.Calendar_Date
Other_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Find the code of the document type "Paper". [/INST]

Output: SELECT document_type_code FROM Ref_document_types WHERE document_type_name  =  "Paper";