answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = "Accounting"
CREATE TABLE professor (dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR)
Find the number of professors in accounting department.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = "Accounting" Context: CREATE TABLE professor (dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of professors in accounting department. The answer to your question is: SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = "Accounting". [/s>
SELECT COUNT(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = "ACCT-211"
CREATE TABLE CLASS (PROF_NUM VARCHAR, CRS_CODE VARCHAR)
How many professors are teaching class with code ACCT-211?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = "ACCT-211" Context: CREATE TABLE CLASS (PROF_NUM VARCHAR, CRS_CODE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many professors are teaching class with code ACCT-211? The answer to your question is: SELECT COUNT(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = "ACCT-211". [/s>
SELECT T3.EMP_FNAME, T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM = T3.EMP_NUM WHERE DEPT_NAME = "Biology"
CREATE TABLE professor (dept_code VARCHAR, EMP_NUM VARCHAR); CREATE TABLE department (dept_code VARCHAR); CREATE TABLE employee (EMP_FNAME VARCHAR, EMP_LNAME VARCHAR, EMP_NUM VARCHAR)
What is the first and last name of the professor in biology department?
<s>[INST] Given the following SQL query and context: Query: SELECT T3.EMP_FNAME, T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM = T3.EMP_NUM WHERE DEPT_NAME = "Biology" Context: CREATE TABLE professor (dept_code VARCHAR, EMP_NUM VARCHAR); CREATE TABLE department (dept_code VARCHAR); CREATE TABLE employee (EMP_FNAME VARCHAR, EMP_LNAME VARCHAR, EMP_NUM VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first and last name of the professor in biology department? The answer to your question is: SELECT T3.EMP_FNAME, T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM = T3.EMP_NUM WHERE DEPT_NAME = "Biology". [/s>
SELECT DISTINCT T1.EMP_FNAME, T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = "ACCT-211"
CREATE TABLE CLASS (PROF_NUM VARCHAR); CREATE TABLE employee (EMP_FNAME VARCHAR, EMP_DOB VARCHAR, EMP_NUM VARCHAR)
What are the first names and date of birth of professors teaching course ACCT-211?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.EMP_FNAME, T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = "ACCT-211" Context: CREATE TABLE CLASS (PROF_NUM VARCHAR); CREATE TABLE employee (EMP_FNAME VARCHAR, EMP_DOB VARCHAR, EMP_NUM VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the first names and date of birth of professors teaching course ACCT-211? The answer to your question is: SELECT DISTINCT T1.EMP_FNAME, T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = "ACCT-211". [/s>
SELECT COUNT(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski'
CREATE TABLE CLASS (PROF_NUM VARCHAR); CREATE TABLE employee (EMP_NUM VARCHAR, EMP_LNAME VARCHAR)
How many classes are professor whose last name is Graztevski has?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski' Context: CREATE TABLE CLASS (PROF_NUM VARCHAR); CREATE TABLE employee (EMP_NUM VARCHAR, EMP_LNAME VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many classes are professor whose last name is Graztevski has? The answer to your question is: SELECT COUNT(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski'. [/s>
SELECT school_code FROM department WHERE dept_name = "Accounting"
CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR)
What is the code of the school where the accounting department belongs to?
<s>[INST] Given the following SQL query and context: Query: SELECT school_code FROM department WHERE dept_name = "Accounting" Context: CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the code of the school where the accounting department belongs to? The answer to your question is: SELECT school_code FROM department WHERE dept_name = "Accounting". [/s>
SELECT crs_credit, crs_description FROM course WHERE crs_code = 'CIS-220'
CREATE TABLE course (crs_credit VARCHAR, crs_description VARCHAR, crs_code VARCHAR)
How many credits does course CIS-220 have, and what its description?
<s>[INST] Given the following SQL query and context: Query: SELECT crs_credit, crs_description FROM course WHERE crs_code = 'CIS-220' Context: CREATE TABLE course (crs_credit VARCHAR, crs_description VARCHAR, crs_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many credits does course CIS-220 have, and what its description? The answer to your question is: SELECT crs_credit, crs_description FROM course WHERE crs_code = 'CIS-220'. [/s>
SELECT dept_address FROM department WHERE dept_name = 'History'
CREATE TABLE department (dept_address VARCHAR, dept_name VARCHAR)
what is the address of history department?
<s>[INST] Given the following SQL query and context: Query: SELECT dept_address FROM department WHERE dept_name = 'History' Context: CREATE TABLE department (dept_address VARCHAR, dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: what is the address of history department? The answer to your question is: SELECT dept_address FROM department WHERE dept_name = 'History'. [/s>
SELECT COUNT(DISTINCT dept_address) FROM department WHERE school_code = 'BUS'
CREATE TABLE department (dept_address VARCHAR, school_code VARCHAR)
How many different locations does the school with code BUS has?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT dept_address) FROM department WHERE school_code = 'BUS' Context: CREATE TABLE department (dept_address VARCHAR, school_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different locations does the school with code BUS has? The answer to your question is: SELECT COUNT(DISTINCT dept_address) FROM department WHERE school_code = 'BUS'. [/s>
SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code
CREATE TABLE department (school_code VARCHAR, dept_address VARCHAR)
How many different locations does each school have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code Context: CREATE TABLE department (school_code VARCHAR, dept_address VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different locations does each school have? The answer to your question is: SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code. [/s>
SELECT crs_credit, crs_description FROM course WHERE crs_code = 'QM-261'
CREATE TABLE course (crs_credit VARCHAR, crs_description VARCHAR, crs_code VARCHAR)
Find the description and credit for the course QM-261?
<s>[INST] Given the following SQL query and context: Query: SELECT crs_credit, crs_description FROM course WHERE crs_code = 'QM-261' Context: CREATE TABLE course (crs_credit VARCHAR, crs_description VARCHAR, crs_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the description and credit for the course QM-261? The answer to your question is: SELECT crs_credit, crs_description FROM course WHERE crs_code = 'QM-261'. [/s>
SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code
CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR)
Find the number of departments in each school.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code Context: CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of departments in each school. The answer to your question is: SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code. [/s>
SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code HAVING COUNT(DISTINCT dept_name) < 5
CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR)
Find the number of different departments in each school whose number of different departments is less than 5.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code HAVING COUNT(DISTINCT dept_name) < 5 Context: CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of different departments in each school whose number of different departments is less than 5. The answer to your question is: SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code HAVING COUNT(DISTINCT dept_name) < 5. [/s>
SELECT COUNT(*), crs_code FROM CLASS GROUP BY crs_code
CREATE TABLE CLASS (crs_code VARCHAR)
How many sections does each course has?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), crs_code FROM CLASS GROUP BY crs_code Context: CREATE TABLE CLASS (crs_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many sections does each course has? The answer to your question is: SELECT COUNT(*), crs_code FROM CLASS GROUP BY crs_code. [/s>
SELECT SUM(crs_credit), dept_code FROM course GROUP BY dept_code
CREATE TABLE course (dept_code VARCHAR, crs_credit INTEGER)
What is the total credit does each department offer?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(crs_credit), dept_code FROM course GROUP BY dept_code Context: CREATE TABLE course (dept_code VARCHAR, crs_credit INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the total credit does each department offer? The answer to your question is: SELECT SUM(crs_credit), dept_code FROM course GROUP BY dept_code. [/s>
SELECT COUNT(*), class_room FROM CLASS GROUP BY class_room HAVING COUNT(*) >= 2
CREATE TABLE CLASS (class_room VARCHAR)
Find the number of classes offered for all class rooms that held at least 2 classes.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), class_room FROM CLASS GROUP BY class_room HAVING COUNT(*) >= 2 Context: CREATE TABLE CLASS (class_room VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of classes offered for all class rooms that held at least 2 classes. The answer to your question is: SELECT COUNT(*), class_room FROM CLASS GROUP BY class_room HAVING COUNT(*) >= 2. [/s>
SELECT COUNT(*), dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code
CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (crs_code VARCHAR)
Find the number of classes in each department.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code Context: CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (crs_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of classes in each department. The answer to your question is: SELECT COUNT(*), dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code. [/s>
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
CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR)
Find the number of classes in each school.
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of classes in each school. The answer to your question is: 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. [/s>
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
CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE professor (dept_code VARCHAR)
What is the number of professors for different school?
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE professor (dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the number of professors for different school? The answer to your question is: 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. [/s>
SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE employee (emp_jobcode VARCHAR)
Find the count and code of the job has most employees.
<s>[INST] Given the following SQL query and context: Query: SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE employee (emp_jobcode VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the count and code of the job has most employees. The answer to your question is: SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1. [/s>
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
CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE professor (dept_code VARCHAR)
Which school has the smallest amount of professors?
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE professor (dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which school has the smallest amount of professors? The answer to your question is: 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. [/s>
SELECT COUNT(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code
CREATE TABLE professor (dept_code VARCHAR, prof_high_degree VARCHAR)
Find the number of professors with a Ph.D. degree in each department.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code Context: CREATE TABLE professor (dept_code VARCHAR, prof_high_degree VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of professors with a Ph.D. degree in each department. The answer to your question is: SELECT COUNT(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code. [/s>
SELECT COUNT(*), dept_code FROM student GROUP BY dept_code
CREATE TABLE student (dept_code VARCHAR)
Find the number of students for each department.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), dept_code FROM student GROUP BY dept_code Context: CREATE TABLE student (dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of students for each department. The answer to your question is: SELECT COUNT(*), dept_code FROM student GROUP BY dept_code. [/s>
SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code
CREATE TABLE student (dept_code VARCHAR, stu_hrs INTEGER)
Find the total number of hours have done for all students in each department.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code Context: CREATE TABLE student (dept_code VARCHAR, stu_hrs INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the total number of hours have done for all students in each department. The answer to your question is: SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code. [/s>
SELECT MAX(stu_gpa), AVG(stu_gpa), MIN(stu_gpa), dept_code FROM student GROUP BY dept_code
CREATE TABLE student (dept_code VARCHAR, stu_gpa INTEGER)
Find the max, average, and minimum gpa of all students in each department.
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(stu_gpa), AVG(stu_gpa), MIN(stu_gpa), dept_code FROM student GROUP BY dept_code Context: CREATE TABLE student (dept_code VARCHAR, stu_gpa INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the max, average, and minimum gpa of all students in each department. The answer to your question is: SELECT MAX(stu_gpa), AVG(stu_gpa), MIN(stu_gpa), dept_code FROM student GROUP BY dept_code. [/s>
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
CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE student (stu_gpa INTEGER, dept_code VARCHAR)
What is the name and the average gpa of department whose students have the highest average gpa?
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE student (stu_gpa INTEGER, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name and the average gpa of department whose students have the highest average gpa? The answer to your question is: 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. [/s>
SELECT COUNT(DISTINCT school_code) FROM department
CREATE TABLE department (school_code VARCHAR)
how many schools exist in total?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT school_code) FROM department Context: CREATE TABLE department (school_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: how many schools exist in total? The answer to your question is: SELECT COUNT(DISTINCT school_code) FROM department. [/s>
SELECT COUNT(DISTINCT class_code) FROM CLASS
CREATE TABLE CLASS (class_code VARCHAR)
How many different classes are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT class_code) FROM CLASS Context: CREATE TABLE CLASS (class_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different classes are there? The answer to your question is: SELECT COUNT(DISTINCT class_code) FROM CLASS. [/s>
SELECT COUNT(DISTINCT crs_code) FROM CLASS
CREATE TABLE CLASS (crs_code VARCHAR)
How many courses are offered?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT crs_code) FROM CLASS Context: CREATE TABLE CLASS (crs_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many courses are offered? The answer to your question is: SELECT COUNT(DISTINCT crs_code) FROM CLASS. [/s>
SELECT COUNT(DISTINCT dept_name) FROM department
CREATE TABLE department (dept_name VARCHAR)
How many departments does the college has?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT dept_name) FROM department Context: CREATE TABLE department (dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many departments does the college has? The answer to your question is: SELECT COUNT(DISTINCT dept_name) FROM department. [/s>
SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = "Computer Info. Systems"
CREATE TABLE course (dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR)
How many courses are offered by the Computer Info. Systems department?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = "Computer Info. Systems" Context: CREATE TABLE course (dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many courses are offered by the Computer Info. Systems department? The answer to your question is: SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = "Computer Info. Systems". [/s>
SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211'
CREATE TABLE CLASS (class_section VARCHAR, crs_code VARCHAR)
How many sections does course ACCT-211 has?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211' Context: CREATE TABLE CLASS (class_section VARCHAR, crs_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many sections does course ACCT-211 has? The answer to your question is: SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211'. [/s>
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
CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_credit INTEGER, crs_code VARCHAR)
Find the total credits of all classes offered by each department.
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_credit INTEGER, crs_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the total credits of all classes offered by each department. The answer to your question is: 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. [/s>
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
CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_code VARCHAR, crs_credit INTEGER)
Find the name of the department that offers the largest number of credits of all classes.
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_code VARCHAR, crs_credit INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of the department that offers the largest number of credits of all classes. The answer to your question is: 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. [/s>
SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'
CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR)
How many students enrolled in class ACCT-211?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211' Context: CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many students enrolled in class ACCT-211? The answer to your question is: SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'. [/s>
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'
CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR)
What is the first name of each student enrolled in class ACCT-211?
<s>[INST] Given the following SQL query and context: Query: 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' Context: CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first name of each student enrolled in class ACCT-211? The answer to your question is: 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'. [/s>
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'
CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR, enroll_grade VARCHAR)
What is the first name of students enrolled in class ACCT-211 and got grade C?
<s>[INST] Given the following SQL query and context: Query: 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' Context: CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR, enroll_grade VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first name of students enrolled in class ACCT-211 and got grade C? The answer to your question is: 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'. [/s>
SELECT COUNT(*) FROM employee
CREATE TABLE employee (Id VARCHAR)
Find the total number of employees.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM employee Context: CREATE TABLE employee (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the total number of employees. The answer to your question is: SELECT COUNT(*) FROM employee. [/s>
SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.'
CREATE TABLE professor (prof_high_degree VARCHAR)
How many professors do have a Ph.D. degree?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' Context: CREATE TABLE professor (prof_high_degree VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many professors do have a Ph.D. degree? The answer to your question is: SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.'. [/s>
SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting'
CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR)
How many students are enrolled in the class taught by some professor from the accounting department?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting' Context: CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many students are enrolled in the class taught by some professor from the accounting department? The answer to your question is: SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting'. [/s>
SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)
What is the name of the department that has the largest number of students enrolled?
<s>[INST] Given the following SQL query and context: Query: SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the department that has the largest number of students enrolled? The answer to your question is: SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT dept_name FROM department ORDER BY dept_name
CREATE TABLE department (dept_name VARCHAR)
list names of all departments ordered by their names.
<s>[INST] Given the following SQL query and context: Query: SELECT dept_name FROM department ORDER BY dept_name Context: CREATE TABLE department (dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: list names of all departments ordered by their names. The answer to your question is: SELECT dept_name FROM department ORDER BY dept_name. [/s>
SELECT class_code FROM CLASS WHERE class_room = 'KLR209'
CREATE TABLE CLASS (class_code VARCHAR, class_room VARCHAR)
List the codes of all courses that take place in room KLR209.
<s>[INST] Given the following SQL query and context: Query: SELECT class_code FROM CLASS WHERE class_room = 'KLR209' Context: CREATE TABLE CLASS (class_code VARCHAR, class_room VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the codes of all courses that take place in room KLR209. The answer to your question is: SELECT class_code FROM CLASS WHERE class_room = 'KLR209'. [/s>
SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob
CREATE TABLE employee (emp_fname VARCHAR, emp_jobcode VARCHAR, emp_dob VARCHAR)
List the first name of all employees with job code PROF ordered by their date of birth.
<s>[INST] Given the following SQL query and context: Query: SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob Context: CREATE TABLE employee (emp_fname VARCHAR, emp_jobcode VARCHAR, emp_dob VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the first name of all employees with job code PROF ordered by their date of birth. The answer to your question is: SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob. [/s>
SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname
CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
Find the first names and offices of all professors sorted by alphabetical order of their first name.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname Context: CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names and offices of all professors sorted by alphabetical order of their first name. The answer to your question is: SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname. [/s>
SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob LIMIT 1
CREATE TABLE employee (emp_fname VARCHAR, emp_lname VARCHAR, emp_dob VARCHAR)
What is the first and last name of the oldest employee?
<s>[INST] Given the following SQL query and context: Query: SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob LIMIT 1 Context: CREATE TABLE employee (emp_fname VARCHAR, emp_lname VARCHAR, emp_dob VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first and last name of the oldest employee? The answer to your question is: SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob LIMIT 1. [/s>
SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1
CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_gpa INTEGER, stu_dob VARCHAR)
What is the first, last name, gpa of the youngest one among students whose GPA is above 3?
<s>[INST] Given the following SQL query and context: Query: SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1 Context: CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_gpa INTEGER, stu_dob VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first, last name, gpa of the youngest one among students whose GPA is above 3? The answer to your question is: SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1. [/s>
SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C'
CREATE TABLE student (stu_num VARCHAR); CREATE TABLE enroll (stu_num VARCHAR)
What is the first name of students who got grade C in any class?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C' Context: CREATE TABLE student (stu_num VARCHAR); CREATE TABLE enroll (stu_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first name of students who got grade C in any class? The answer to your question is: SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C'. [/s>
SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) LIMIT 1
CREATE TABLE professor (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)
What is the name of department where has the smallest number of professors?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) LIMIT 1 Context: CREATE TABLE professor (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of department where has the smallest number of professors? The answer to your question is: SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) LIMIT 1. [/s>
SELECT T2.dept_name, T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE professor (dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)
What is the name of department where has the largest number of professors with a Ph.D. degree?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.dept_name, T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE professor (dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of department where has the largest number of professors with a Ph.D. degree? The answer to your question is: SELECT T2.dept_name, T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num
CREATE TABLE employee (emp_fname VARCHAR, emp_jobcode VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
What are the first names of the professors who do not teach a class.
<s>[INST] Given the following SQL query and context: Query: SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num Context: CREATE TABLE employee (emp_fname VARCHAR, emp_jobcode VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the first names of the professors who do not teach a class. The answer to your question is: SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num. [/s>
SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num
CREATE TABLE professor (emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
What is the first names of the professors from the history department who do not teach a class.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num Context: CREATE TABLE professor (emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first names of the professors from the history department who do not teach a class. The answer to your question is: SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num. [/s>
SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'
CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_lname VARCHAR, emp_num VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR)
What is the last name and office of the professor from the history department?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' Context: CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_lname VARCHAR, emp_num VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the last name and office of the professor from the history department? The answer to your question is: SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'. [/s>
SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'
CREATE TABLE employee (emp_num VARCHAR, emp_lname VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR)
What is department name and office for the professor whose last name is Heffington?
<s>[INST] Given the following SQL query and context: Query: SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington' Context: CREATE TABLE employee (emp_num VARCHAR, emp_lname VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is department name and office for the professor whose last name is Heffington? The answer to your question is: SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'. [/s>
SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'
CREATE TABLE professor (emp_num VARCHAR, prof_office VARCHAR); CREATE TABLE employee (emp_lname VARCHAR, emp_hiredate VARCHAR, emp_num VARCHAR)
Find the last name and hire date of the professor who is in office DRE 102.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102' Context: CREATE TABLE professor (emp_num VARCHAR, prof_office VARCHAR); CREATE TABLE employee (emp_lname VARCHAR, emp_hiredate VARCHAR, emp_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the last name and hire date of the professor who is in office DRE 102. The answer to your question is: SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'. [/s>
SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson'
CREATE TABLE student (stu_num VARCHAR, stu_lname VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR); CREATE TABLE CLASS (crs_code VARCHAR, class_code VARCHAR)
What is the code of the course which the student whose last name is Smithson took?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson' Context: CREATE TABLE student (stu_num VARCHAR, stu_lname VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR); CREATE TABLE CLASS (crs_code VARCHAR, class_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the code of the course which the student whose last name is Smithson took? The answer to your question is: SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson'. [/s>
SELECT T4.crs_description, T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'
CREATE TABLE student (stu_num VARCHAR, stu_lname VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_credit VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR)
What are the description and credit of the course which the student whose last name is Smithson took?
<s>[INST] Given the following SQL query and context: Query: SELECT T4.crs_description, T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson' Context: CREATE TABLE student (stu_num VARCHAR, stu_lname VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_credit VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the description and credit of the course which the student whose last name is Smithson took? The answer to your question is: SELECT T4.crs_description, T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'. [/s>
SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA'
CREATE TABLE professor (prof_high_degree VARCHAR)
How many professors who has a either Ph.D. or MA degree?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA' Context: CREATE TABLE professor (prof_high_degree VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many professors who has a either Ph.D. or MA degree? The answer to your question is: SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA'. [/s>
SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'
CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (dept_code VARCHAR)
How many professors who are from either Accounting or Biology department?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology' Context: CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many professors who are from either Accounting or Biology department? The answer to your question is: SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'. [/s>
SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261'
CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
Find the first name of the professor who is teaching two courses with code CIS-220 and QM-261.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261' Context: CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first name of the professor who is teaching two courses with code CIS-220 and QM-261. The answer to your question is: SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261'. [/s>
SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'
CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR)
Find the first name of student who is taking classes from accounting and Computer Info. Systems departments
<s>[INST] Given the following SQL query and context: Query: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems' Context: CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first name of student who is taking classes from accounting and Computer Info. Systems departments The answer to your question is: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'. [/s>
SELECT AVG(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211'
CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_gpa INTEGER, stu_num VARCHAR)
What is the average gpa of the students enrolled in the course with code ACCT-211?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' Context: CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_gpa INTEGER, stu_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the average gpa of the students enrolled in the course with code ACCT-211? The answer to your question is: SELECT AVG(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211'. [/s>
SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5
CREATE TABLE student (stu_gpa VARCHAR, stu_phone VARCHAR, stu_fname VARCHAR)
What is the first name, gpa and phone number of the top 5 students with highest gpa?
<s>[INST] Given the following SQL query and context: Query: SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5 Context: CREATE TABLE student (stu_gpa VARCHAR, stu_phone VARCHAR, stu_fname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first name, gpa and phone number of the top 5 students with highest gpa? The answer to your question is: SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5. [/s>
SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1
CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)
What is the department name of the students with lowest gpa belongs to?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1 Context: CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the department name of the students with lowest gpa belongs to? The answer to your question is: SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1. [/s>
SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa < (SELECT AVG(stu_gpa) FROM student)
CREATE TABLE student (stu_fname VARCHAR, stu_gpa INTEGER)
Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.
<s>[INST] Given the following SQL query and context: Query: SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa < (SELECT AVG(stu_gpa) FROM student) Context: CREATE TABLE student (stu_fname VARCHAR, stu_gpa INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the first name and gpa of the students whose gpa is lower than the average gpa of all students. The answer to your question is: SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa < (SELECT AVG(stu_gpa) FROM student). [/s>
SELECT T2.dept_name, T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_address VARCHAR, dept_code VARCHAR)
Find the name and address of the department that has the highest number of students.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.dept_name, T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_address VARCHAR, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name and address of the department that has the highest number of students. The answer to your question is: SELECT T2.dept_name, T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT T2.dept_name, T2.dept_address, COUNT(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 3
CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_address VARCHAR, dept_code VARCHAR)
Find the name, address, number of students in the departments that have the top 3 highest number of students.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.dept_name, T2.dept_address, COUNT(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 3 Context: CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_address VARCHAR, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name, address, number of students in the departments that have the top 3 highest number of students. The answer to your question is: SELECT T2.dept_name, T2.dept_address, COUNT(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 3. [/s>
SELECT T1.emp_fname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'
CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
Find the first name and office of the professor who is in the history department and has a Ph.D. degree.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.emp_fname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.' Context: CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first name and office of the professor who is in the history department and has a Ph.D. degree. The answer to your question is: SELECT T1.emp_fname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'. [/s>
SELECT T2.emp_fname, T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num
CREATE TABLE CLASS (crs_code VARCHAR, prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
Find the first names of all instructors who have taught some course and the course code.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.emp_fname, T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num Context: CREATE TABLE CLASS (crs_code VARCHAR, prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names of all instructors who have taught some course and the course code. The answer to your question is: SELECT T2.emp_fname, T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num. [/s>
SELECT T2.emp_fname, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code
CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
Find the first names of all instructors who have taught some course and the course description.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.emp_fname, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code Context: CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names of all instructors who have taught some course and the course description. The answer to your question is: SELECT T2.emp_fname, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code. [/s>
SELECT T2.emp_fname, T4.prof_office, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num
CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
Find the first names and offices of all instructors who have taught some course and also find the course description.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.emp_fname, T4.prof_office, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num Context: CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names and offices of all instructors who have taught some course and also find the course description. The answer to your question is: SELECT T2.emp_fname, T4.prof_office, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num. [/s>
SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code
CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR)
Find the first names and offices of all instructors who have taught some course and the course description and the department name.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code Context: CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names and offices of all instructors who have taught some course and the course description and the department name. The answer to your question is: SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code. [/s>
SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code
CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_num VARCHAR)
Find names of all students who took some course and the course description.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code Context: CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find names of all students who took some course and the course description. The answer to your question is: SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code. [/s>
SELECT T1.stu_fname, T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'
CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_num VARCHAR)
Find names of all students who took some course and got A or C.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.stu_fname, T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A' Context: CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find names of all students who took some course and got A or C. The answer to your question is: SELECT T1.stu_fname, T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'. [/s>
SELECT T2.emp_fname, T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'
CREATE TABLE CLASS (class_room VARCHAR, prof_num VARCHAR); CREATE TABLE professor (emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
Find the first names of all professors in the Accounting department who is teaching some course and the class room.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.emp_fname, T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting' Context: CREATE TABLE CLASS (class_room VARCHAR, prof_num VARCHAR); CREATE TABLE professor (emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names of all professors in the Accounting department who is teaching some course and the class room. The answer to your question is: SELECT T2.emp_fname, T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'. [/s>
SELECT DISTINCT T2.emp_fname, T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'
CREATE TABLE professor (prof_high_degree VARCHAR, emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR)
Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.emp_fname, T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems' Context: CREATE TABLE professor (prof_high_degree VARCHAR, emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department. The answer to your question is: SELECT DISTINCT T2.emp_fname, T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'. [/s>
SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018
CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR, class_code VARCHAR); CREATE TABLE student (stu_lname VARCHAR, stu_num VARCHAR)
What is the last name of the student who got a grade A in the class with code 10018.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018 Context: CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR, class_code VARCHAR); CREATE TABLE student (stu_lname VARCHAR, stu_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the last name of the student who got a grade A in the class with code 10018. The answer to your question is: SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018. [/s>
SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree <> 'Ph.D.'
CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
Find the first name and office of history professor who did not get a Ph.D. degree.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree <> 'Ph.D.' Context: CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first name and office of history professor who did not get a Ph.D. degree. The answer to your question is: SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree <> 'Ph.D.'. [/s>
SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING COUNT(*) > 1
CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR)
Find the first names of professors who are teaching more than one class.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING COUNT(*) > 1 Context: CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names of professors who are teaching more than one class. The answer to your question is: SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING COUNT(*) > 1. [/s>
SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING COUNT(*) = 1
CREATE TABLE enroll (stu_num VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR)
Find the first names of students who took exactly one class.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING COUNT(*) = 1 Context: CREATE TABLE enroll (stu_num VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names of students who took exactly one class. The answer to your question is: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING COUNT(*) = 1. [/s>
SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%'
CREATE TABLE course (dept_code VARCHAR, crs_description VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)
Find the name of department that offers the class whose description has the word "Statistics".
<s>[INST] Given the following SQL query and context: Query: SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%' Context: CREATE TABLE course (dept_code VARCHAR, crs_description VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of department that offers the class whose description has the word "Statistics". The answer to your question is: SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%'. [/s>
SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%'
CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR, stu_lname VARCHAR)
What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%' Context: CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR, stu_lname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class? The answer to your question is: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%'. [/s>
SELECT COUNT(*) FROM club
CREATE TABLE club (Id VARCHAR)
How many clubs are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM club Context: CREATE TABLE club (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many clubs are there? The answer to your question is: SELECT COUNT(*) FROM club. [/s>
SELECT DISTINCT Region FROM club ORDER BY Region
CREATE TABLE club (Region VARCHAR)
List the distinct region of clubs in ascending alphabetical order.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Region FROM club ORDER BY Region Context: CREATE TABLE club (Region VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the distinct region of clubs in ascending alphabetical order. The answer to your question is: SELECT DISTINCT Region FROM club ORDER BY Region. [/s>
SELECT AVG(Gold) FROM club_rank
CREATE TABLE club_rank (Gold INTEGER)
What is the average number of gold medals for clubs?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Gold) FROM club_rank Context: CREATE TABLE club_rank (Gold INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average number of gold medals for clubs? The answer to your question is: SELECT AVG(Gold) FROM club_rank. [/s>
SELECT Competition_type, Country FROM competition
CREATE TABLE competition (Competition_type VARCHAR, Country VARCHAR)
What are the types and countries of competitions?
<s>[INST] Given the following SQL query and context: Query: SELECT Competition_type, Country FROM competition Context: CREATE TABLE competition (Competition_type VARCHAR, Country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the types and countries of competitions? The answer to your question is: SELECT Competition_type, Country FROM competition. [/s>
SELECT DISTINCT YEAR FROM competition WHERE Competition_type <> "Tournament"
CREATE TABLE competition (YEAR VARCHAR, Competition_type VARCHAR)
What are the distinct years in which the competitions type is not "Tournament"?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT YEAR FROM competition WHERE Competition_type <> "Tournament" Context: CREATE TABLE competition (YEAR VARCHAR, Competition_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the distinct years in which the competitions type is not "Tournament"? The answer to your question is: SELECT DISTINCT YEAR FROM competition WHERE Competition_type <> "Tournament". [/s>
SELECT MAX(Silver), MIN(Silver) FROM club_rank
CREATE TABLE club_rank (Silver INTEGER)
What are the maximum and minimum number of silver medals for clubs.
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(Silver), MIN(Silver) FROM club_rank Context: CREATE TABLE club_rank (Silver INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the maximum and minimum number of silver medals for clubs. The answer to your question is: SELECT MAX(Silver), MIN(Silver) FROM club_rank. [/s>
SELECT COUNT(*) FROM club_rank WHERE Total < 10
CREATE TABLE club_rank (Total INTEGER)
How many clubs have total medals less than 10?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM club_rank WHERE Total < 10 Context: CREATE TABLE club_rank (Total INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many clubs have total medals less than 10? The answer to your question is: SELECT COUNT(*) FROM club_rank WHERE Total < 10. [/s>
SELECT name FROM club ORDER BY Start_year
CREATE TABLE club (name VARCHAR, Start_year VARCHAR)
List all club names in ascending order of start year.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM club ORDER BY Start_year Context: CREATE TABLE club (name VARCHAR, Start_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all club names in ascending order of start year. The answer to your question is: SELECT name FROM club ORDER BY Start_year. [/s>
SELECT name FROM club ORDER BY name DESC
CREATE TABLE club (name VARCHAR)
List all club names in descending alphabetical order.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM club ORDER BY name DESC Context: CREATE TABLE club (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all club names in descending alphabetical order. The answer to your question is: SELECT name FROM club ORDER BY name DESC. [/s>
SELECT T1.name, T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID
CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Player_id VARCHAR, Club_ID VARCHAR)
Please show the names and the players of clubs.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID Context: CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Player_id VARCHAR, Club_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the names and the players of clubs. The answer to your question is: SELECT T1.name, T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID. [/s>
SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing"
CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Club_ID VARCHAR, Position VARCHAR)
Show the names of clubs that have players with position "Right Wing".
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing" Context: CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Club_ID VARCHAR, Position VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of clubs that have players with position "Right Wing". The answer to your question is: SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing". [/s>
SELECT AVG(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "AIB"
CREATE TABLE player (Points INTEGER, Club_ID VARCHAR); CREATE TABLE club (Club_ID VARCHAR, name VARCHAR)
What is the average points of players from club with name "AIB".
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "AIB" Context: CREATE TABLE player (Points INTEGER, Club_ID VARCHAR); CREATE TABLE club (Club_ID VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the average points of players from club with name "AIB". The answer to your question is: SELECT AVG(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "AIB". [/s>
SELECT POSITION, AVG(Points) FROM player GROUP BY POSITION
CREATE TABLE player (POSITION VARCHAR, Points INTEGER)
List the position of players and the average number of points of players of each position.
<s>[INST] Given the following SQL query and context: Query: SELECT POSITION, AVG(Points) FROM player GROUP BY POSITION Context: CREATE TABLE player (POSITION VARCHAR, Points INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the position of players and the average number of points of players of each position. The answer to your question is: SELECT POSITION, AVG(Points) FROM player GROUP BY POSITION. [/s>
SELECT POSITION FROM player GROUP BY name HAVING AVG(Points) >= 20
CREATE TABLE player (POSITION VARCHAR, name VARCHAR, Points INTEGER)
List the position of players with average number of points scored by players of that position bigger than 20.
<s>[INST] Given the following SQL query and context: Query: SELECT POSITION FROM player GROUP BY name HAVING AVG(Points) >= 20 Context: CREATE TABLE player (POSITION VARCHAR, name VARCHAR, Points INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the position of players with average number of points scored by players of that position bigger than 20. The answer to your question is: SELECT POSITION FROM player GROUP BY name HAVING AVG(Points) >= 20. [/s>
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type
CREATE TABLE competition (Competition_type VARCHAR)
List the types of competition and the number of competitions of each type.
<s>[INST] Given the following SQL query and context: Query: SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type Context: CREATE TABLE competition (Competition_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the types of competition and the number of competitions of each type. The answer to your question is: SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type. [/s>
SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE competition (Competition_type VARCHAR)
List the most common type of competition.
<s>[INST] Given the following SQL query and context: Query: SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE competition (Competition_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the most common type of competition. The answer to your question is: SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5
CREATE TABLE competition (Competition_type VARCHAR)
List the types of competition that have at most five competitions of that type.
<s>[INST] Given the following SQL query and context: Query: SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5 Context: CREATE TABLE competition (Competition_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the types of competition that have at most five competitions of that type. The answer to your question is: SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5. [/s>
SELECT name FROM CLub WHERE NOT Club_ID IN (SELECT Club_ID FROM player)
CREATE TABLE player (name VARCHAR, Club_ID VARCHAR); CREATE TABLE CLub (name VARCHAR, Club_ID VARCHAR)
List the names of clubs that do not have any players.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM CLub WHERE NOT Club_ID IN (SELECT Club_ID FROM player) Context: CREATE TABLE player (name VARCHAR, Club_ID VARCHAR); CREATE TABLE CLub (name VARCHAR, Club_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of clubs that do not have any players. The answer to your question is: SELECT name FROM CLub WHERE NOT Club_ID IN (SELECT Club_ID FROM player). [/s>