Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: Find the total number of employees. [/INST]

Output: SELECT count(*) FROM employee;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

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

Output: SELECT count(*) FROM employee;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: How many professors do have a Ph.D. degree? [/INST]

Output: SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the total number of professors with a Ph.D. ? [/INST]

Output: SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: How many students are enrolled in the class taught by some professor from the accounting department? [/INST]

Output: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN course AS T3 ON T1.crs_code  =  T3.crs_code JOIN department AS T4 ON T3.dept_code  =  T4.dept_code WHERE T4.dept_name  =  'Accounting';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: How many students are enrolled in some classes that are taught by an accounting professor? [/INST]

Output: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN course AS T3 ON T1.crs_code  =  T3.crs_code JOIN department AS T4 ON T3.dept_code  =  T4.dept_code WHERE T4.dept_name  =  'Accounting';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the name of the department that has the largest number of students enrolled? [/INST]

Output: SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN course AS T3 ON T1.crs_code  =  T3.crs_code JOIN department AS T4 ON T3.dept_code  =  T4.dept_code GROUP BY T3.dept_code ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the name of the department with the most students enrolled? [/INST]

Output: SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN course AS T3 ON T1.crs_code  =  T3.crs_code JOIN department AS T4 ON T3.dept_code  =  T4.dept_code GROUP BY T3.dept_code ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: list names of all departments ordered by their names. [/INST]

Output: SELECT dept_name FROM department ORDER BY dept_name;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the names of all departments in alphabetical order? [/INST]

Output: SELECT dept_name FROM department ORDER BY dept_name;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: List the codes of all courses that take place in room KLR209. [/INST]

Output: SELECT class_code FROM CLASS WHERE class_room  =  'KLR209';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the codes of all the courses that are located in room KLR209? [/INST]

Output: SELECT class_code FROM CLASS WHERE class_room  =  'KLR209';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: List the first name of all employees with job code PROF ordered by their date of birth. [/INST]

Output: SELECT emp_fname FROM employee WHERE emp_jobcode  =  'PROF' ORDER BY emp_dob;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the first names of all employees that are professors ordered by date of birth? [/INST]

Output: SELECT emp_fname FROM employee WHERE emp_jobcode  =  'PROF' ORDER BY emp_dob;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: Find the first names and offices of all professors sorted by alphabetical order of their first name. [/INST]

Output: SELECT T2.emp_fname ,  T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num  =  T2.emp_num ORDER BY T2.emp_fname;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the first names and office locations for all professors sorted alphabetically by first name? [/INST]

Output: SELECT T2.emp_fname ,  T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num  =  T2.emp_num ORDER BY T2.emp_fname;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the first and last name of the oldest employee? [/INST]

Output: SELECT emp_fname ,  emp_lname FROM employee ORDER BY emp_dob LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the first and last names of the employee with the earliest date of birth? [/INST]

Output: SELECT emp_fname ,  emp_lname FROM employee ORDER BY emp_dob LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the first, last name, gpa of the youngest one among students whose GPA is above 3? [/INST]

Output: SELECT stu_fname ,  stu_lname ,  stu_gpa FROM student WHERE stu_gpa  >  3 ORDER BY stu_dob DESC LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the first and last name of the youngest student with a GPA above 3, and what is their GPA? [/INST]

Output: SELECT stu_fname ,  stu_lname ,  stu_gpa FROM student WHERE stu_gpa  >  3 ORDER BY stu_dob DESC LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the first name of students who got grade C in any class? [/INST]

Output: SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num WHERE enroll_grade  =  'C';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the first names of all students who got a grade C in a class? [/INST]

Output: SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num WHERE enroll_grade  =  'C';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the name of department where has the smallest number of professors? [/INST]

Output: SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the name of the department with the fewest professors? [/INST]

Output: SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the name of department where has the largest number of professors with a Ph.D. degree? [/INST]

Output: SELECT T2.dept_name ,  T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE T1.prof_high_degree  =  'Ph.D.' GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: Which department has the most professors with a Ph.D.? [/INST]

Output: SELECT T2.dept_name ,  T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE T1.prof_high_degree  =  'Ph.D.' GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the first names of the professors who do not teach a class. [/INST]

Output: SELECT emp_fname FROM employee WHERE emp_jobcode  =  'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num  =  T2.prof_num;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the first names of all professors not teaching any classes? [/INST]

Output: SELECT emp_fname FROM employee WHERE emp_jobcode  =  'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num  =  T2.prof_num;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the first names of the professors from the history department who do not teach a class. [/INST]

Output: SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T3.dept_name  =  'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num  =  T5.prof_num;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the first names of all history professors who do not teach? [/INST]

Output: SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T3.dept_name  =  'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num  =  T5.prof_num;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the last name and office of the professor from the history department? [/INST]

Output: SELECT T1.emp_lname ,  T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T3.dept_name  =  'History';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

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

Output: SELECT T1.emp_lname ,  T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T3.dept_name  =  'History';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is department name and office for the professor whose last name is Heffington? [/INST]

Output: SELECT T3.dept_name  ,  T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T1.emp_lname  =  'Heffington';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the name of the department and office location for the professor with the last name of Heffington? [/INST]

Output: SELECT T3.dept_name  ,  T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T1.emp_lname  =  'Heffington';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: Find the last name and hire date of the professor who is in office DRE 102. [/INST]

Output: SELECT T1.emp_lname ,  T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num WHERE T2.prof_office  =  'DRE 102';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the last name of the professor whose office is located in DRE 102, and when were they hired? [/INST]

Output: SELECT T1.emp_lname ,  T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num WHERE T2.prof_office  =  'DRE 102';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the code of the course which the student whose last name is Smithson took? [/INST]

Output: SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T3.stu_num  =  T2.stu_num WHERE T3.stu_lname  =  'Smithson';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the course codes for every class that the student with the last name Smithson took? [/INST]

Output: SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T3.stu_num  =  T2.stu_num WHERE T3.stu_lname  =  'Smithson';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the description and credit of the course which the student whose last name is Smithson took? [/INST]

Output: SELECT T4.crs_description ,  T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T3.stu_num  =  T2.stu_num JOIN course AS T4 ON T4.crs_code  =  T1.crs_code WHERE T3.stu_lname  =  'Smithson';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: How many credits is the course that the student with the last name Smithson took, and what is its description? [/INST]

Output: SELECT T4.crs_description ,  T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T3.stu_num  =  T2.stu_num JOIN course AS T4 ON T4.crs_code  =  T1.crs_code WHERE T3.stu_lname  =  'Smithson';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: How many professors who has a either Ph.D. or MA degree? [/INST]

Output: SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.' OR prof_high_degree  =  'MA';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: How many professors attained either Ph.D. or Masters degrees? [/INST]

Output: SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.' OR prof_high_degree  =  'MA';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: How many professors who are from either Accounting or Biology department? [/INST]

Output: SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE T2.dept_name  =  'Accounting' OR T2.dept_name  =  'Biology';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the number of professors who are in the Accounting or Biology departments? [/INST]

Output: SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE T2.dept_name  =  'Accounting' OR T2.dept_name  =  'Biology';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: Find the first name of the professor who is teaching two courses with code CIS-220 and QM-261. [/INST]

Output: SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num  =  T2.prof_num WHERE crs_code  =  'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num  =  T2.prof_num WHERE crs_code  =  'QM-261';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the first name of the professor who is teaching CIS-220 and QM-261? [/INST]

Output: SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num  =  T2.prof_num WHERE crs_code  =  'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num  =  T2.prof_num WHERE crs_code  =  'QM-261';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: Find the first name of student who is taking classes from accounting and Computer Info. Systems departments [/INST]

Output: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num JOIN CLASS AS T3 ON T2.class_code  =  T3.class_code JOIN course AS T4 ON T3.crs_code  =  T4.crs_code JOIN department AS T5 ON T5.dept_code  =  T4.dept_code WHERE T5.dept_name  =  'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num JOIN CLASS AS T3 ON T2.class_code  =  T3.class_code JOIN course AS T4 ON T3.crs_code  =  T4.crs_code JOIN department AS T5 ON T5.dept_code  =  T4.dept_code WHERE T5.dept_name  =  'Computer Info. Systems';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What are the first names of all students taking accoutning and Computer Information Systems classes? [/INST]

Output: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num JOIN CLASS AS T3 ON T2.class_code  =  T3.class_code JOIN course AS T4 ON T3.crs_code  =  T4.crs_code JOIN department AS T5 ON T5.dept_code  =  T4.dept_code WHERE T5.dept_name  =  'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num JOIN CLASS AS T3 ON T2.class_code  =  T3.class_code JOIN course AS T4 ON T3.crs_code  =  T4.crs_code JOIN department AS T5 ON T5.dept_code  =  T4.dept_code WHERE T5.dept_name  =  'Computer Info. Systems';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the average gpa of the students enrolled in the course with code ACCT-211? [/INST]

Output: SELECT avg(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num  =  T2.stu_num JOIN CLASS AS T3 ON T1.class_code  =  T3.class_code WHERE T3.crs_code  =  'ACCT-211';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the average GPA of students taking ACCT-211? [/INST]

Output: SELECT avg(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num  =  T2.stu_num JOIN CLASS AS T3 ON T1.class_code  =  T3.class_code WHERE T3.crs_code  =  'ACCT-211';


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the first name, gpa and phone number of the top 5 students with highest gpa? [/INST]

Output: SELECT stu_gpa ,  stu_phone ,  stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the first name, GPA, and phone number of the students with the top 5 GPAs? [/INST]

Output: SELECT stu_gpa ,  stu_phone ,  stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the department name of the students with lowest gpa belongs to? [/INST]

Output: SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code ORDER BY stu_gpa LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the name of the department with the student that has the lowest GPA? [/INST]

Output: SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code ORDER BY stu_gpa LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: Find the first name and gpa of the students whose gpa is lower than the average gpa of all students. [/INST]

Output: SELECT stu_fname ,  stu_gpa FROM student WHERE stu_gpa  <  (SELECT avg(stu_gpa) FROM student);


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the first name and GPA of every student that has a GPA lower than average? [/INST]

Output: SELECT stu_fname ,  stu_gpa FROM student WHERE stu_gpa  <  (SELECT avg(stu_gpa) FROM student);


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: Find the name and address of the department that has the highest number of students. [/INST]

Output: SELECT T2.dept_name ,  T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: What is the name and address of the department with the most students? [/INST]

Output: SELECT T2.dept_name ,  T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
CLASS :
CLASS_CODE [ TEXT ] primary_key
CRS_CODE [ TEXT ] CLASS.CRS_CODE = COURSE.CRS_CODE
CLASS_SECTION [ TEXT ]
CLASS_TIME [ TEXT ]
CLASS_ROOM [ TEXT ]
PROF_NUM [ INT ] CLASS.PROF_NUM = EMPLOYEE.EMP_NUM

COURSE :
CRS_CODE [ TEXT ] primary_key
DEPT_CODE [ TEXT ] COURSE.DEPT_CODE = DEPARTMENT.DEPT_CODE
CRS_DESCRIPTION [ TEXT ]
CRS_CREDIT [ INT ]

DEPARTMENT :
DEPT_CODE [ TEXT ] primary_key
DEPT_NAME [ TEXT ]
SCHOOL_CODE [ TEXT ]
EMP_NUM [ INT ] DEPARTMENT.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_ADDRESS [ TEXT ]
DEPT_EXTENSION [ TEXT ]

EMPLOYEE :
EMP_NUM [ INT ] primary_key
EMP_LNAME [ TEXT ]
EMP_FNAME [ TEXT ]
EMP_INITIAL [ TEXT ]
EMP_JOBCODE [ TEXT ]
EMP_HIREDATE [ TEXT ]
EMP_DOB [ TEXT ]

ENROLL :
CLASS_CODE [ TEXT ] ENROLL.CLASS_CODE = CLASS.CLASS_CODE
STU_NUM [ INT ] ENROLL.STU_NUM = STUDENT.STU_NUM
ENROLL_GRADE [ TEXT ]

PROFESSOR :
EMP_NUM [ INT ] PROFESSOR.EMP_NUM = EMPLOYEE.EMP_NUM
DEPT_CODE [ TEXT ] PROFESSOR.DEPT_CODE = DEPARTMENT.DEPT_CODE
PROF_OFFICE [ TEXT ]
PROF_EXTENSION [ TEXT ]
PROF_HIGH_DEGREE [ TEXT ]

STUDENT :
STU_NUM [ INT ] primary_key
STU_LNAME [ TEXT ]
STU_FNAME [ TEXT ]
STU_INIT [ TEXT ]
STU_DOB [ TEXT ]
STU_HRS [ INT ]
STU_CLASS [ TEXT ]
STU_GPA [ INT ]
STU_TRANSFER [ INT ]
DEPT_CODE [ TEXT ] STUDENT.DEPT_CODE = DEPARTMENT.DEPT_CODE
STU_PHONE [ TEXT ]
PROF_NUM [ INT ]

Please write me a SQL statement that answers the following question: Find the name, address, number of students in the departments that have the top 3 highest number of students. [/INST]

Output: SELECT T2.dept_name ,  T2.dept_address ,  count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3;