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 does course CIS-220 have, and what its description? [/INST]

Output: SELECT crs_credit ,  crs_description FROM course WHERE crs_code  =  'CIS-220';


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 description for the CIS-220 and how many credits does it have? [/INST]

Output: SELECT crs_credit ,  crs_description FROM course WHERE crs_code  =  'CIS-220';


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 address of history department? [/INST]

Output: SELECT dept_address FROM department WHERE 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: Where is the history department? [/INST]

Output: SELECT dept_address FROM department WHERE 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: How many different locations does the school with code BUS has? [/INST]

Output: SELECT count(DISTINCT dept_address) FROM department WHERE school_code  =  'BUS';


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 different locations of the school with the code BUS? [/INST]

Output: SELECT count(DISTINCT dept_address) FROM department WHERE school_code  =  'BUS';


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 different locations does each school have? [/INST]

Output: SELECT count(DISTINCT dept_address) ,  school_code FROM department GROUP BY school_code;


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: Count different addresses of each school. [/INST]

Output: SELECT count(DISTINCT dept_address) ,  school_code FROM department GROUP BY school_code;


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 description and credit for the course QM-261? [/INST]

Output: SELECT crs_credit ,  crs_description FROM course 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 course description and number of credits for QM-261? [/INST]

Output: SELECT crs_credit ,  crs_description FROM course 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 number of departments in each school. [/INST]

Output: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code;


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 departments are in each school? [/INST]

Output: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code;


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 number of different departments in each school whose number of different departments is less than 5. [/INST]

Output: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name)  <  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: How many different departments are there in each school that has less than 5 apartments? [/INST]

Output: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name)  <  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: How many sections does each course has? [/INST]

Output: SELECT count(*) ,  crs_code FROM CLASS GROUP BY crs_code;


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 sections does each course have? [/INST]

Output: SELECT count(*) ,  crs_code FROM CLASS GROUP BY crs_code;


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 credit does each department offer? [/INST]

Output: SELECT sum(crs_credit) ,  dept_code FROM course GROUP BY dept_code;


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 does the department offer? [/INST]

Output: SELECT sum(crs_credit) ,  dept_code FROM course GROUP BY dept_code;


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 number of classes offered for all class rooms that held at least 2 classes. [/INST]

Output: SELECT count(*) ,  class_room FROM CLASS GROUP BY class_room HAVING count(*)  >=  2;


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: For each classroom with at least 2 classes, how many classes are offered? [/INST]

Output: SELECT count(*) ,  class_room FROM CLASS GROUP BY class_room HAVING count(*)  >=  2;


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 number of classes in each department. [/INST]

Output: SELECT count(*) ,  dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY dept_code;


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 classes are held in each department? [/INST]

Output: SELECT count(*) ,  dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY dept_code;


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 number of classes in each school. [/INST]

Output: SELECT count(*) ,  T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T2.dept_code  =  T3.dept_code GROUP BY T3.school_code;


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 classes exist for each school? [/INST]

Output: SELECT count(*) ,  T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T2.dept_code  =  T3.dept_code GROUP BY T3.school_code;


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 for different school? [/INST]

Output: SELECT count(*) ,  T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_code;


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 different professors are there for the different schools? [/INST]

Output: SELECT count(*) ,  T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_code;


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 count and code of the job has most employees. [/INST]

Output: SELECT emp_jobcode ,  count(*) FROM employee GROUP BY emp_jobcode 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 count and code of the job with the most employee? [/INST]

Output: SELECT emp_jobcode ,  count(*) FROM employee GROUP BY emp_jobcode 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 school has the smallest amount of professors? [/INST]

Output: SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_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: Which school has the fewest professors? [/INST]

Output: SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_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: Find the number of professors with a Ph.D. degree in each department. [/INST]

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


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 have a Ph.D. in each department? [/INST]

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


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 number of students for each department. [/INST]

Output: SELECT count(*) ,  dept_code FROM student GROUP BY dept_code;


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 in each department? [/INST]

Output: SELECT count(*) ,  dept_code FROM student GROUP BY dept_code;


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 hours have done for all students in each department. [/INST]

Output: SELECT sum(stu_hrs) ,  dept_code FROM student GROUP BY dept_code;


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 hours do the students spend studying in each department? [/INST]

Output: SELECT sum(stu_hrs) ,  dept_code FROM student GROUP BY dept_code;


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 max, average, and minimum gpa of all students in each department. [/INST]

Output: SELECT max(stu_gpa) ,  avg(stu_gpa) ,  min(stu_gpa) ,  dept_code FROM student GROUP BY dept_code;


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 highest, lowest, and average student GPA for every department? [/INST]

Output: SELECT max(stu_gpa) ,  avg(stu_gpa) ,  min(stu_gpa) ,  dept_code FROM student GROUP BY dept_code;


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 the average gpa of department whose students have the highest average gpa? [/INST]

Output: SELECT T2.dept_name ,  avg(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY avg(T1.stu_gpa) 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 highest average student GPA, and what is the average gpa? [/INST]

Output: SELECT T2.dept_name ,  avg(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY avg(T1.stu_gpa) 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: how many schools exist in total? [/INST]

Output: SELECT count(DISTINCT school_code) FROM department;


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 schools are there in the department? [/INST]

Output: SELECT count(DISTINCT school_code) FROM department;


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 different classes are there? [/INST]

Output: SELECT count(DISTINCT class_code) FROM CLASS;


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 unique classes are offered? [/INST]

Output: SELECT count(DISTINCT class_code) FROM CLASS;


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 courses are offered? [/INST]

Output: SELECT count(DISTINCT crs_code) FROM CLASS;


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 number of different course codes? [/INST]

Output: SELECT count(DISTINCT crs_code) FROM CLASS;


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 departments does the college has? [/INST]

Output: SELECT count(DISTINCT dept_name) FROM department;


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 different departments are there? [/INST]

Output: SELECT count(DISTINCT dept_name) FROM department;


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 courses are offered by the Computer Info. Systems department? [/INST]

Output: SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code  =  T2.dept_code WHERE 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: How many courses does the department of Computer Information Systmes offer? [/INST]

Output: SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code  =  T2.dept_code WHERE 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: How many sections does course ACCT-211 has? [/INST]

Output: SELECT count(DISTINCT class_section) FROM CLASS WHERE 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 number of different class sections offered in the course ACCT-211? [/INST]

Output: SELECT count(DISTINCT class_section) FROM CLASS WHERE 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: Find the total credits of all classes offered by each department. [/INST]

Output: SELECT sum(T1.crs_credit) ,  T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY T1.dept_code;


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 total number of credits offered by each department? [/INST]

Output: SELECT sum(T1.crs_credit) ,  T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY T1.dept_code;


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 of the department that offers the largest number of credits of all classes. [/INST]

Output: SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T1.dept_code  =  T3.dept_code GROUP BY T1.dept_code ORDER BY sum(T1.crs_credit) 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 offers the most credits all together? [/INST]

Output: SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T1.dept_code  =  T3.dept_code GROUP BY T1.dept_code ORDER BY sum(T1.crs_credit) 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: How many students enrolled in class ACCT-211? [/INST]

Output: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code WHERE T1.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 are the total number of students enrolled in ACCT-211? [/INST]

Output: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code WHERE T1.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 of each student enrolled in class ACCT-211? [/INST]

Output: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T2.stu_num  =  T3.stu_num WHERE T1.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 are the first names of all students in course ACCT-211? [/INST]

Output: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T2.stu_num  =  T3.stu_num WHERE T1.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 of students enrolled in class ACCT-211 and got grade C? [/INST]

Output: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T2.stu_num  =  T3.stu_num WHERE T1.crs_code  =  'ACCT-211' AND T2.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 took ACCT-211 and received a C? [/INST]

Output: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T2.stu_num  =  T3.stu_num WHERE T1.crs_code  =  'ACCT-211' AND T2.enroll_grade  =  'C';