output
stringlengths 18
577
| instruction
stringlengths 16
224
| input
stringclasses 160
values |
---|---|---|
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 | What is the name of the department with the student that has the lowest GPA? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
SELECT stu_fname , stu_gpa FROM student WHERE stu_gpa < (SELECT avg(stu_gpa) FROM student) | Find the first name and gpa of the students whose gpa is lower than the average gpa of all students. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
SELECT stu_fname , stu_gpa FROM student WHERE stu_gpa < (SELECT avg(stu_gpa) FROM student) | What is the first name and GPA of every student that has a GPA lower than average? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | Find the name and address of the department that has the highest number of students. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | What is the name and address of the department with the most students? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | Find the name, address, number of students in the departments that have the top 3 highest number of students. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | What is the name, address, and number of students in the departments that have the 3 most students? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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.' | Find the first name and office of the professor who is in the history department and has a Ph.D. degree. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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.' | What are the first names and office of the professors who are in the history department and have a Ph.D? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
SELECT T2.emp_fname , T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num | Find the first names of all instructors who have taught some course and the course code. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
SELECT T2.emp_fname , T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num | What are the first names of all teachers who have taught a course and the corresponding course codes? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | Find the first names of all instructors who have taught some course and the course description. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | What are the first names of all teachers who have taught a course and the corresponding descriptions? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | Find the first names and offices of all instructors who have taught some course and also find the course description. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | What are the first names, office locations of all lecturers who have taught some course? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | Find the first names and offices of all instructors who have taught some course and the course description and the department name. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | What are the first names, office locations, and departments of all instructors, and also what are the descriptions of the courses they teach? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | Find names of all students who took some course and the course description. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | What are the names of all students who took a class and the corresponding course descriptions? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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' | Find names of all students who took some course and got A or C. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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' | What are the names of all students taking a course who received an A or C? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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' | Find the first names of all professors in the Accounting department who is teaching some course and the class room. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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' | What are the first names of all Accounting professors who teach and what are the classrooms of the courses they teach? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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' | Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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' | What are the different first names and highest degree attained for professors teaching in the Computer Information Systems department? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | What is the last name of the student who got a grade A in the class with code 10018. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | What is the last name of the student who received an A in the class with the code 10018? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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.' | Find the first name and office of history professor who did not get a Ph.D. degree. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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.' | What are the first names and offices of history professors who don't have Ph.D.s? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | Find the first names of professors who are teaching more than one class. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | What are the first names of all professors who teach more than one class? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | Find the first names of students who took exactly one class. | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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 | What are the first names of student who only took one course? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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%' | Find the name of department that offers the class whose description has the word "Statistics". | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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%' | What is the name of the department that offers a course that has a description including the word "Statistics"? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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%' | What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
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%' | What is the first name of the student whose last name starts with the letter S and is taking ACCT-211? | "Schema (values (type))": CLASS : CLASS_CODE (text) , CRS_CODE (text) , CLASS_SECTION (text) , CLASS_TIME (text) , CLASS_ROOM (text) , PROF_NUM (number) | COURSE : CRS_CODE (text) , DEPT_CODE (text) , CRS_DESCRIPTION (text) , CRS_CREDIT (number) | DEPARTMENT : DEPT_CODE (text) , DEPT_NAME (text) , SCHOOL_CODE (text) , EMP_NUM (number) , DEPT_ADDRESS (text) , DEPT_EXTENSION (text) | EMPLOYEE : EMP_NUM (number) , EMP_LNAME (text) , EMP_FNAME (text) , EMP_INITIAL (text) , EMP_JOBCODE (text) , EMP_HIREDATE (time) , EMP_DOB (time) | ENROLL : CLASS_CODE (text) , STU_NUM (number) , ENROLL_GRADE (text) | PROFESSOR : EMP_NUM (number) , DEPT_CODE (text) , PROF_OFFICE (text) , PROF_EXTENSION (text) , PROF_HIGH_DEGREE (text) | STUDENT : STU_NUM (number) , STU_LNAME (text) , STU_FNAME (text) , STU_INIT (text) , STU_DOB (time) , STU_HRS (number) , STU_CLASS (text) , STU_GPA (number) , STU_TRANSFER (number) , DEPT_CODE (text) , STU_PHONE (text) , PROF_NUM (number)
"Primary Keys": CLASS : CLASS_CODE | COURSE : CRS_CODE | DEPARTMENT : DEPT_CODE | EMPLOYEE : EMP_NUM | STUDENT : STU_NUM
"Foreign Keys": CLASS : PROF_NUM equals EMPLOYEE : EMP_NUM | CLASS : CRS_CODE equals COURSE : CRS_CODE | COURSE : DEPT_CODE equals DEPARTMENT : DEPT_CODE | DEPARTMENT : EMP_NUM equals EMPLOYEE : EMP_NUM | ENROLL : STU_NUM equals STUDENT : STU_NUM | ENROLL : CLASS_CODE equals CLASS : CLASS_CODE | PROFESSOR : DEPT_CODE equals DEPARTMENT : DEPT_CODE | PROFESSOR : EMP_NUM equals EMPLOYEE : EMP_NUM | STUDENT : DEPT_CODE equals DEPARTMENT : DEPT_CODE |
SELECT count(*) FROM club | How many clubs are there? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT count(*) FROM club | What is the total number of clubs? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT DISTINCT Region FROM club ORDER BY Region ASC | List the distinct region of clubs in ascending alphabetical order. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT DISTINCT Region FROM club ORDER BY Region ASC | What are the different regions of clubs in ascending alphabetical order? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT avg(Gold) FROM club_rank | What is the average number of gold medals for clubs? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT avg(Gold) FROM club_rank | What is the average number of gold medals for a club? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT Competition_type , Country FROM competition | What are the types and countries of competitions? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT Competition_type , Country FROM competition | What are the types of every competition and in which countries are they located? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT DISTINCT YEAR FROM competition WHERE Competition_type != "Tournament" | What are the distinct years in which the competitions type is not "Tournament"? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT DISTINCT YEAR FROM competition WHERE Competition_type != "Tournament" | What are the different years for all competitions that are not of type equal to tournament? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT max(Silver) , min(Silver) FROM club_rank | What are the maximum and minimum number of silver medals for clubs. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT max(Silver) , min(Silver) FROM club_rank | What are the maximum and minimum number of silver medals for all the clubs? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT count(*) FROM club_rank WHERE Total < 10 | How many clubs have total medals less than 10? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT count(*) FROM club_rank WHERE Total < 10 | What is the total number of clubs that have less than 10 medals in total? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT name FROM club ORDER BY Start_year ASC | List all club names in ascending order of start year. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT name FROM club ORDER BY Start_year ASC | What are the names of all the clubs starting with the oldest? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT name FROM club ORDER BY name DESC | List all club names in descending alphabetical order. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT name FROM club ORDER BY name DESC | What are the names of all the clubs ordered in descending alphabetical order? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT T1.name , T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID | Please show the names and the players of clubs. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT T1.name , T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID | What are the names and players of all the clubs? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing" | Show the names of clubs that have players with position "Right Wing". | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing" | What are the names of the clubs that have players in the position of "Right Wing"? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "AIB" | What is the average points of players from club with name "AIB". | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "AIB" | What is the average number of points for players from the "AIB" club? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT POSITION , avg(Points) FROM player GROUP BY POSITION | List the position of players and the average number of points of players of each position. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT POSITION , avg(Points) FROM player GROUP BY POSITION | For each position, what is the average number of points for players in that position? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT POSITION FROM player GROUP BY name HAVING avg(Points) >= 20 | List the position of players with average number of points scored by players of that position bigger than 20. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT POSITION FROM player GROUP BY name HAVING avg(Points) >= 20 | What are the positions of players whose average number of points scored by that position is larger than 20? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT Competition_type , COUNT(*) FROM competition GROUP BY Competition_type | List the types of competition and the number of competitions of each type. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT Competition_type , COUNT(*) FROM competition GROUP BY Competition_type | What are the types of competition and number of competitions for that type? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1 | List the most common type of competition. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1 | What is the most common competition type? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5 | List the types of competition that have at most five competitions of that type. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5 | What are the types of competition that have most 5 competitions for that type? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player) | List the names of clubs that do not have any players. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player) | What are the names of all clubs that do not have any players? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10 | What are the positions with both players having more than 20 points and less than 10 points. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10 | What are the positions of both players that have more than 20 20 points and less than 10 points? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT sum(Points) FROM player | Show total points of all players. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT sum(Points) FROM player | What is the total number of points for all players? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT count(DISTINCT POSITION) FROM player | how many different positions are there? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT count(DISTINCT POSITION) FROM player | How many different position for players are listed? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT name FROM player WHERE points > (SELECT avg(points) FROM player) | what are the name of players who get more than the average points. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT name FROM player WHERE points > (SELECT avg(points) FROM player) | What are the names of all players that got more than the average number of points? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT count(*) , POSITION FROM player WHERE points < 30 GROUP BY POSITION | find the number of players whose points are lower than 30 in each position. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT count(*) , POSITION FROM player WHERE points < 30 GROUP BY POSITION | What is the number of players who have points less than 30 for each position? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1 | which country did participated in the most number of Tournament competitions? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1 | what is the name of the country that participated in the most tournament competitions? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament' | which countries did participated in both Friendly and Tournament type competitions. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament' | What are the countries that participated in both friendly and tournament type competitions? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly' | Find the countries that have never participated in any competition with Friendly type. | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly' | What are the countries that have never participated in any friendly-type competitions? | "Schema (values (type))": club : Club_ID (number) , name (text) , Region (text) , Start_year (text) | club_rank : Rank (number) , Club_ID (number) , Gold (number) , Silver (number) , Bronze (number) , Total (number) | player : Player_ID (number) , name (text) , Position (text) , Club_ID (number) , Apps (number) , Tries (number) , Goals (text) , Points (number) | competition : Competition_ID (number) , Year (number) , Competition_type (text) , Country (text) | competition_result : Competition_ID (number) , Club_ID_1 (number) , Club_ID_2 (number) , Score (text)
"Primary Keys": club : Club_ID | club_rank : Rank | player : Player_ID | competition : Competition_ID | competition_result : Competition_ID
"Foreign Keys": club_rank : Club_ID equals club : Club_ID | player : Club_ID equals club : Club_ID | competition_result : Competition_ID equals competition : Competition_ID | competition_result : Club_ID_2 equals club : Club_ID | competition_result : Club_ID_1 equals club : Club_ID |
SELECT sum(num_of_component) FROM furniture | How many furniture components are there in total? | "Schema (values (type))": manufacturer : Manufacturer_ID (number) , Open_Year (number) , Name (text) , Num_of_Factories (number) , Num_of_Shops (number) | furniture : Furniture_ID (number) , Name (text) , Num_of_Component (number) , Market_Rate (number) | furniture_manufacte : Manufacturer_ID (number) , Furniture_ID (number) , Price_in_Dollar (number)
"Primary Keys": manufacturer : Manufacturer_ID | furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID
"Foreign Keys": furniture_manufacte : Furniture_ID equals furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID equals manufacturer : Manufacturer_ID |
SELECT name , furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1 | Return the name and id of the furniture with the highest market rate. | "Schema (values (type))": manufacturer : Manufacturer_ID (number) , Open_Year (number) , Name (text) , Num_of_Factories (number) , Num_of_Shops (number) | furniture : Furniture_ID (number) , Name (text) , Num_of_Component (number) , Market_Rate (number) | furniture_manufacte : Manufacturer_ID (number) , Furniture_ID (number) , Price_in_Dollar (number)
"Primary Keys": manufacturer : Manufacturer_ID | furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID
"Foreign Keys": furniture_manufacte : Furniture_ID equals furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID equals manufacturer : Manufacturer_ID |
SELECT sum(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2 | find the total market rate of the furnitures that have the top 2 market shares. | "Schema (values (type))": manufacturer : Manufacturer_ID (number) , Open_Year (number) , Name (text) , Num_of_Factories (number) , Num_of_Shops (number) | furniture : Furniture_ID (number) , Name (text) , Num_of_Component (number) , Market_Rate (number) | furniture_manufacte : Manufacturer_ID (number) , Furniture_ID (number) , Price_in_Dollar (number)
"Primary Keys": manufacturer : Manufacturer_ID | furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID
"Foreign Keys": furniture_manufacte : Furniture_ID equals furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID equals manufacturer : Manufacturer_ID |
SELECT Num_of_Component , name FROM furniture WHERE Num_of_Component > 10 | Find the component amounts and names of all furnitures that have more than 10 components. | "Schema (values (type))": manufacturer : Manufacturer_ID (number) , Open_Year (number) , Name (text) , Num_of_Factories (number) , Num_of_Shops (number) | furniture : Furniture_ID (number) , Name (text) , Num_of_Component (number) , Market_Rate (number) | furniture_manufacte : Manufacturer_ID (number) , Furniture_ID (number) , Price_in_Dollar (number)
"Primary Keys": manufacturer : Manufacturer_ID | furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID
"Foreign Keys": furniture_manufacte : Furniture_ID equals furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID equals manufacturer : Manufacturer_ID |
SELECT name , Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1 | Find the name and component amount of the least popular furniture. | "Schema (values (type))": manufacturer : Manufacturer_ID (number) , Open_Year (number) , Name (text) , Num_of_Factories (number) , Num_of_Shops (number) | furniture : Furniture_ID (number) , Name (text) , Num_of_Component (number) , Market_Rate (number) | furniture_manufacte : Manufacturer_ID (number) , Furniture_ID (number) , Price_in_Dollar (number)
"Primary Keys": manufacturer : Manufacturer_ID | furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID
"Foreign Keys": furniture_manufacte : Furniture_ID equals furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID equals manufacturer : Manufacturer_ID |
SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT max(Price_in_Dollar) FROM furniture_manufacte) | Find the names of furnitures whose prices are lower than the highest price. | "Schema (values (type))": manufacturer : Manufacturer_ID (number) , Open_Year (number) , Name (text) , Num_of_Factories (number) , Num_of_Shops (number) | furniture : Furniture_ID (number) , Name (text) , Num_of_Component (number) , Market_Rate (number) | furniture_manufacte : Manufacturer_ID (number) , Furniture_ID (number) , Price_in_Dollar (number)
"Primary Keys": manufacturer : Manufacturer_ID | furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID
"Foreign Keys": furniture_manufacte : Furniture_ID equals furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID equals manufacturer : Manufacturer_ID |
SELECT open_year , name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1 | Which manufacturer has the most number of shops? List its name and year of opening. | "Schema (values (type))": manufacturer : Manufacturer_ID (number) , Open_Year (number) , Name (text) , Num_of_Factories (number) , Num_of_Shops (number) | furniture : Furniture_ID (number) , Name (text) , Num_of_Component (number) , Market_Rate (number) | furniture_manufacte : Manufacturer_ID (number) , Furniture_ID (number) , Price_in_Dollar (number)
"Primary Keys": manufacturer : Manufacturer_ID | furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID
"Foreign Keys": furniture_manufacte : Furniture_ID equals furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID equals manufacturer : Manufacturer_ID |
SELECT avg(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20 | Find the average number of factories for the manufacturers that have more than 20 shops. | "Schema (values (type))": manufacturer : Manufacturer_ID (number) , Open_Year (number) , Name (text) , Num_of_Factories (number) , Num_of_Shops (number) | furniture : Furniture_ID (number) , Name (text) , Num_of_Component (number) , Market_Rate (number) | furniture_manufacte : Manufacturer_ID (number) , Furniture_ID (number) , Price_in_Dollar (number)
"Primary Keys": manufacturer : Manufacturer_ID | furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID
"Foreign Keys": furniture_manufacte : Furniture_ID equals furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID equals manufacturer : Manufacturer_ID |
SELECT name , manufacturer_id FROM manufacturer ORDER BY open_year | List all manufacturer names and ids ordered by their opening year. | "Schema (values (type))": manufacturer : Manufacturer_ID (number) , Open_Year (number) , Name (text) , Num_of_Factories (number) , Num_of_Shops (number) | furniture : Furniture_ID (number) , Name (text) , Num_of_Component (number) , Market_Rate (number) | furniture_manufacte : Manufacturer_ID (number) , Furniture_ID (number) , Price_in_Dollar (number)
"Primary Keys": manufacturer : Manufacturer_ID | furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID
"Foreign Keys": furniture_manufacte : Furniture_ID equals furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID equals manufacturer : Manufacturer_ID |
SELECT name , open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10 | Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops. | "Schema (values (type))": manufacturer : Manufacturer_ID (number) , Open_Year (number) , Name (text) , Num_of_Factories (number) , Num_of_Shops (number) | furniture : Furniture_ID (number) , Name (text) , Num_of_Component (number) , Market_Rate (number) | furniture_manufacte : Manufacturer_ID (number) , Furniture_ID (number) , Price_in_Dollar (number)
"Primary Keys": manufacturer : Manufacturer_ID | furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID
"Foreign Keys": furniture_manufacte : Furniture_ID equals furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID equals manufacturer : Manufacturer_ID |
SELECT max(num_of_shops) , avg(Num_of_Factories) FROM manufacturer WHERE open_year < 1990 | what is the average number of factories and maximum number of shops for manufacturers that opened before 1990. | "Schema (values (type))": manufacturer : Manufacturer_ID (number) , Open_Year (number) , Name (text) , Num_of_Factories (number) , Num_of_Shops (number) | furniture : Furniture_ID (number) , Name (text) , Num_of_Component (number) , Market_Rate (number) | furniture_manufacte : Manufacturer_ID (number) , Furniture_ID (number) , Price_in_Dollar (number)
"Primary Keys": manufacturer : Manufacturer_ID | furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID
"Foreign Keys": furniture_manufacte : Furniture_ID equals furniture : Furniture_ID | furniture_manufacte : Manufacturer_ID equals manufacturer : Manufacturer_ID |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.