cnatale/presto-athena-txt-2-sql huggingface dataset:
Find the number of classes in each school.
Additional table information: table: college_1
SQL: SELECT COUNT(*), T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T2.dept_code = T3.dept_code GROUP BY T3.school_code
How many classes exist for each school?
Additional table information: table: college_1
SQL: SELECT COUNT(*), T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T2.dept_code = T3.dept_code GROUP BY T3.school_code
What is the number of professors for different school?
Additional table information: table: college_1
SQL: SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code
How many different professors are there for the different schools?
Additional table information: table: college_1
SQL: SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code
Find the count and code of the job has most employees.
Additional table information: table: college_1
SQL: SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1
What is the count and code of the job with the most employee?
Additional table information: table: college_1
SQL: SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1
Which school has the smallest amount of professors?
Additional table information: table: college_1
SQL: SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY COUNT(*) NULLS FIRST LIMIT 1
Which school has the fewest professors?
Additional table information: table: college_1
SQL: SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY COUNT(*) NULLS FIRST LIMIT 1
Find the number of professors with a Ph.D. degree in each department.
Additional table information: table: college_1
SQL: SELECT COUNT(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code
How many professors have a Ph.D. in each department?
Additional table information: table: college_1
SQL: SELECT COUNT(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code
Find the number of students for each department.
Additional table information: table: college_1
SQL: SELECT COUNT(*), dept_code FROM student GROUP BY dept_code
How many students are in each department?
Additional table information: table: college_1
SQL: SELECT COUNT(*), dept_code FROM student GROUP BY dept_code
Find the total number of hours have done for all students in each department.
Additional table information: table: college_1
SQL: SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code
How many hours do the students spend studying in each department?
Additional table information: table: college_1
SQL: SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code
Find the max, average, and minimum gpa of all students in each department.
Additional table information: table: college_1
SQL: SELECT MAX(stu_gpa), AVG(stu_gpa), MIN(stu_gpa), dept_code FROM student GROUP BY dept_code
What is the highest, lowest, and average student GPA for every department?
Additional table information: table: college_1
SQL: SELECT MAX(stu_gpa), AVG(stu_gpa), MIN(stu_gpa), dept_code FROM student GROUP BY dept_code
What is the name and the average gpa of department whose students have the highest average gpa?
Additional table information: table: college_1
SQL: SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1
Which department has the highest average student GPA, and what is the average gpa?
Additional table information: table: college_1
SQL: SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1
how many schools exist in total?
Additional table information: table: college_1
SQL: SELECT COUNT(DISTINCT school_code) FROM department
How many schools are there in the department?
Additional table information: table: college_1
SQL: SELECT COUNT(DISTINCT school_code) FROM department
How many different classes are there?
Additional table information: table: college_1
SQL: SELECT COUNT(DISTINCT class_code) FROM CLASS
How many unique classes are offered?
Additional table information: table: college_1
SQL: SELECT COUNT(DISTINCT class_code) FROM CLASS
How many courses are offered?
Additional table information: table: college_1
SQL: SELECT COUNT(DISTINCT crs_code) FROM CLASS
What are the number of different course codes?
Additional table information: table: college_1
SQL: SELECT COUNT(DISTINCT crs_code) FROM CLASS
How many departments does the college has?
Additional table information: table: college_1
SQL: SELECT COUNT(DISTINCT dept_name) FROM department
How many different departments are there?
Additional table information: table: college_1
SQL: SELECT COUNT(DISTINCT dept_name) FROM department
How many courses are offered by the Computer Info. Systems department?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = 'Computer Info. Systems'
How many courses does the department of Computer Information Systmes offer?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = 'Computer Info. Systems'
How many sections does course ACCT-211 has?
Additional table information: table: college_1
SQL: SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211'
What is the number of different class sections offered in the course ACCT-211?
Additional table information: table: college_1
SQL: SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211'
Find the total credits of all classes offered by each department.
Additional table information: table: college_1
SQL: SELECT SUM(T1.crs_credit), T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code GROUP BY T1.dept_code
What are the total number of credits offered by each department?
Additional table information: table: college_1
SQL: SELECT SUM(T1.crs_credit), T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code GROUP BY T1.dept_code
Find the name of the department that offers the largest number of credits of all classes.
Additional table information: table: college_1
SQL: SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T1.dept_code = T3.dept_code GROUP BY T1.dept_code ORDER BY SUM(T1.crs_credit) DESC LIMIT 1
Which department offers the most credits all together?
Additional table information: table: college_1
SQL: SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T1.dept_code = T3.dept_code GROUP BY T1.dept_code ORDER BY SUM(T1.crs_credit) DESC LIMIT 1
How many students enrolled in class ACCT-211?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'
What are the total number of students enrolled in ACCT-211?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'
What is the first name of each student enrolled in class ACCT-211?
Additional table information: table: college_1
SQL: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211'
What are the first names of all students in course ACCT-211?
Additional table information: table: college_1
SQL: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211'
What is the first name of students enrolled in class ACCT-211 and got grade C?
Additional table information: table: college_1
SQL: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C'
What are the first names of all students who took ACCT-211 and received a C?
Additional table information: table: college_1
SQL: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C'
Find the total number of employees.
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM employee
How many employees are there all together?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM employee
How many professors do have a Ph.D. degree?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.'
What is the total number of professors with a Ph.D. ?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.'
How many students are enrolled in the class taught by some professor from the accounting department?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting'
How many students are enrolled in some classes that are taught by an accounting professor?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting'
What is the name of the department that has the largest number of students enrolled?
Additional table information: table: college_1
SQL: SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY COUNT(*) DESC LIMIT 1
What is the name of the department with the most students enrolled?
Additional table information: table: college_1
SQL: SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY COUNT(*) DESC LIMIT 1
list names of all departments ordered by their names.
Additional table information: table: college_1
SQL: SELECT dept_name FROM department ORDER BY dept_name NULLS FIRST
What are the names of all departments in alphabetical order?
Additional table information: table: college_1
SQL: SELECT dept_name FROM department ORDER BY dept_name NULLS FIRST
List the codes of all courses that take place in room KLR209.
Additional table information: table: college_1
SQL: SELECT class_code FROM CLASS WHERE class_room = 'KLR209'
What are the codes of all the courses that are located in room KLR209?
Additional table information: table: college_1
SQL: SELECT class_code FROM CLASS WHERE class_room = 'KLR209'
List the first name of all employees with job code PROF ordered by their date of birth.
Additional table information: table: college_1
SQL: SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob NULLS FIRST
What are the first names of all employees that are professors ordered by date of birth?
Additional table information: table: college_1
SQL: SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob NULLS FIRST
Find the first names and offices of all professors sorted by alphabetical order of their first name.
Additional table information: table: college_1
SQL: SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname NULLS FIRST
What are the first names and office locations for all professors sorted alphabetically by first name?
Additional table information: table: college_1
SQL: SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname NULLS FIRST
What is the first and last name of the oldest employee?
Additional table information: table: college_1
SQL: SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob NULLS FIRST LIMIT 1
What are the first and last names of the employee with the earliest date of birth?
Additional table information: table: college_1
SQL: SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob NULLS FIRST LIMIT 1
What is the first, last name, gpa of the youngest one among students whose GPA is above 3?
Additional table information: table: college_1
SQL: SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1
What is the first and last name of the youngest student with a GPA above 3, and what is their GPA?
Additional table information: table: college_1
SQL: SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1
What is the first name of students who got grade C in any class?
Additional table information: table: college_1
SQL: SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C'
What are the first names of all students who got a grade C in a class?
Additional table information: table: college_1
SQL: SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C'
What is the name of department where has the smallest number of professors?
Additional table information: table: college_1
SQL: SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) NULLS FIRST LIMIT 1
What is the name of the department with the fewest professors?
Additional table information: table: college_1
SQL: SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) NULLS FIRST LIMIT 1
What is the name of department where has the largest number of professors with a Ph.D. degree?
Additional table information: table: college_1
SQL: SELECT T2.dept_name, T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1
Which department has the most professors with a Ph.D.?
Additional table information: table: college_1
SQL: SELECT T2.dept_name, T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1
What are the first names of the professors who do not teach a class.
Additional table information: table: college_1
SQL: SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num
What are the first names of all professors not teaching any classes?
Additional table information: table: college_1
SQL: SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num
What is the first names of the professors from the history department who do not teach a class.
Additional table information: table: college_1
SQL: SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num
What are the first names of all history professors who do not teach?
Additional table information: table: college_1
SQL: SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num
What is the last name and office of the professor from the history department?
Additional table information: table: college_1
SQL: SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'
What are the last name and office of all history professors?
Additional table information: table: college_1
SQL: SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'
What is department name and office for the professor whose last name is Heffington?
Additional table information: table: college_1
SQL: SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'
What is the name of the department and office location for the professor with the last name of Heffington?
Additional table information: table: college_1
SQL: SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'
Find the last name and hire date of the professor who is in office DRE 102.
Additional table information: table: college_1
SQL: SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'
What is the last name of the professor whose office is located in DRE 102, and when were they hired?
Additional table information: table: college_1
SQL: SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'
What is the code of the course which the student whose last name is Smithson took?
Additional table information: table: college_1
SQL: SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson'
What are the course codes for every class that the student with the last name Smithson took?
Additional table information: table: college_1
SQL: SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson'
What are the description and credit of the course which the student whose last name is Smithson took?
Additional table information: table: college_1
SQL: SELECT T4.crs_description, T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'
How many credits is the course that the student with the last name Smithson took, and what is its description?
Additional table information: table: college_1
SQL: SELECT T4.crs_description, T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'
How many professors who has a either Ph.D. or MA degree?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA'
How many professors attained either Ph.D. or Masters degrees?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA'
How many professors who are from either Accounting or Biology department?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'
What is the number of professors who are in the Accounting or Biology departments?
Additional table information: table: college_1
SQL: SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'
Find the first name of the professor who is teaching two courses with code CIS-220 and QM-261.
Additional table information: table: college_1
SQL: SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261'
What is the first name of the professor who is teaching CIS-220 and QM-261?
Additional table information: table: college_1
SQL: SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261'
Find the first name of student who is taking classes from accounting and Computer Info. Systems departments
Additional table information: table: college_1
SQL: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'
What are the first names of all students taking accoutning and Computer Information Systems classes?
Additional table information: table: college_1
SQL: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'
What is the average gpa of the students enrolled in the course with code ACCT-211?
Additional table information: table: college_1
SQL: SELECT AVG(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211'
What is the average GPA of students taking ACCT-211?
Additional table information: table: college_1
SQL: SELECT AVG(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211'
What is the first name, gpa and phone number of the top 5 students with highest gpa?
Additional table information: table: college_1
SQL: SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5
What is the first name, GPA, and phone number of the students with the top 5 GPAs?
Additional table information: table: college_1
SQL: SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5
What is the department name of the students with lowest gpa belongs to?
Additional table information: table: college_1
SQL: SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa NULLS FIRST LIMIT 1
What is the name of the department with the student that has the lowest GPA?
Additional table information: table: college_1
SQL: SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa NULLS FIRST LIMIT 1
Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa < (SELECT AVG(stu_gpa) FROM student)
Find the name and address of the department that has the highest number of students.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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, address, number of students in the departments that have the top 3 highest number of students.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 first name and office of the professor who is in the history department and has a Ph.D. degree.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 names of all instructors who have taught some course and the course code.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 description.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 and offices of all instructors who have taught some course and also find the course description.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 the course description and the department name.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 names of all students who took some course and the course description.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 got A or C.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 the first names of all professors in the Accounting department who is teaching some course and the class room.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 and degree of all professors who are teaching some class in Computer Info. Systems department.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 is the last name of the student who got a grade A in the class with code 10018.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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
Find the first name and office of history professor who did not get a Ph.D. degree.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 names of professors who are teaching more than one class.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 students who took exactly one class.
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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 name of department that offers the class whose description has the word 'Statistics'.
Additional table information: table: college_1
SQL: 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'?
Additional table information: table: college_1
SQL: 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 first name of the student whose last name starting with the letter S and is taking ACCT-211 class?
Additional table information: table: college_1
SQL: 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?
Additional table information: table: college_1
SQL: 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%'
How many clubs are there?
Additional table information: table: sports_competition
SQL: SELECT COUNT(*) FROM club
What is the total number of clubs?
Additional table information: table: sports_competition
SQL: SELECT COUNT(*) FROM club
List the distinct region of clubs in ascending alphabetical order.
Additional table information: table: sports_competition
SQL: SELECT DISTINCT Region FROM club ORDER BY Region ASC NULLS FIRST
What are the different regions of clubs in ascending alphabetical order?
Additional table information: table: sports_competition
SQL: SELECT DISTINCT Region FROM club ORDER BY Region ASC NULLS FIRST
What is the average number of gold medals for clubs?
Additional table information: table: sports_competition
SQL: SELECT AVG(Gold) FROM club_rank
What is the average number of gold medals for a club?
Additional table information: table: sports_competition
SQL: SELECT AVG(Gold) FROM club_rank
What are the types and countries of competitions?
Additional table information: table: sports_competition
SQL: SELECT Competition_type, Country FROM competition
What are the types of every competition and in which countries are they located?
Additional table information: table: sports_competition
SQL: SELECT Competition_type, Country FROM competition
What are the distinct years in which the competitions type is not 'Tournament'?
Additional table information: table: sports_competition
SQL: 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?
Additional table information: table: sports_competition
SQL: SELECT DISTINCT YEAR FROM competition WHERE Competition_type <> 'Tournament'
What are the maximum and minimum number of silver medals for clubs.
Additional table information: table: sports_competition
SQL: SELECT MAX(Silver), MIN(Silver) FROM club_rank
What are the maximum and minimum number of silver medals for all the clubs?
Additional table information: table: sports_competition
SQL: SELECT MAX(Silver), MIN(Silver) FROM club_rank
How many clubs have total medals less than 10?
Additional table information: table: sports_competition
SQL: SELECT COUNT(*) FROM club_rank WHERE Total < 10
What is the total number of clubs that have less than 10 medals in total?
Additional table information: table: sports_competition
SQL: SELECT COUNT(*) FROM club_rank WHERE Total < 10
List all club names in ascending order of start year.
Additional table information: table: sports_competition
SQL: SELECT name FROM club ORDER BY Start_year ASC NULLS FIRST
What are the names of all the clubs starting with the oldest?
Additional table information: table: sports_competition
SQL: SELECT name FROM club ORDER BY Start_year ASC NULLS FIRST
List all club names in descending alphabetical order.
Additional table information: table: sports_competition
SQL: SELECT name FROM club ORDER BY name DESC
What are the names of all the clubs ordered in descending alphabetical order?
Additional table information: table: sports_competition
SQL: SELECT name FROM club ORDER BY name DESC
Please show the names and the players of clubs.
Additional table information: table: sports_competition
SQL: 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?
Additional table information: table: sports_competition
SQL: SELECT T1.name, T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID
Show the names of clubs that have players with position 'Right Wing'.
Additional table information: table: sports_competition
SQL: 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'?
Additional table information: table: sports_competition
SQL: SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = 'Right Wing'
What is the average points of players from club with name 'AIB'.
Additional table information: table: sports_competition
SQL: 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?
Additional table information: table: sports_competition
SQL: SELECT AVG(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = 'AIB'
List the position of players and the average number of points of players of each position.
Additional table information: table: sports_competition
SQL: SELECT POSITION, AVG(Points) FROM player GROUP BY POSITION
For each position, what is the average number of points for players in that position?
Additional table information: table: sports_competition
SQL: SELECT POSITION, AVG(Points) FROM player GROUP BY POSITION
List the position of players with average number of points scored by players of that position bigger than 20.
Additional table information: table: sports_competition
SQL: 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?
Additional table information: table: sports_competition
SQL: SELECT POSITION FROM player GROUP BY name HAVING AVG(Points) >= 20
List the types of competition and the number of competitions of each type.
Additional table information: table: sports_competition
SQL: SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type
What are the types of competition and number of competitions for that type?
Additional table information: table: sports_competition
SQL: SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type
List the most common type of competition.
Additional table information: table: sports_competition
SQL: SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1
What is the most common competition type?
Additional table information: table: sports_competition
SQL: SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1
List the types of competition that have at most five competitions of that type.
Additional table information: table: sports_competition
SQL: 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?
Additional table information: table: sports_competition
SQL: SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5
List the names of clubs that do not have any players.
Additional table information: table: sports_competition
SQL: SELECT name FROM CLub WHERE NOT Club_ID IN (SELECT Club_ID FROM player)
What are the names of all clubs that do not have any players?
Additional table information: table: sports_competition
SQL: SELECT name FROM CLub WHERE NOT Club_ID IN (SELECT Club_ID FROM player)
What are the positions with both players having more than 20 points and less than 10 points.
Additional table information: table: sports_competition
SQL: 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?
Additional table information: table: sports_competition
SQL: SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10
Show total points of all players.
Additional table information: table: sports_competition
SQL: SELECT SUM(Points) FROM player
What is the total number of points for all players?
Additional table information: table: sports_competition
SQL: SELECT SUM(Points) FROM player
how many different positions are there?
Additional table information: table: sports_competition
SQL: SELECT COUNT(DISTINCT POSITION) FROM player
How many different position for players are listed?
Additional table information: table: sports_competition
SQL: SELECT COUNT(DISTINCT POSITION) FROM player
what are the name of players who get more than the average points.
Additional table information: table: sports_competition
SQL: 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?
Additional table information: table: sports_competition
SQL: SELECT name FROM player WHERE points > (SELECT AVG(points) FROM player)
find the number of players whose points are lower than 30 in each position.
Additional table information: table: sports_competition
SQL: 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?
Additional table information: table: sports_competition
SQL: SELECT COUNT(*), POSITION FROM player WHERE points < 30 GROUP BY POSITION
which country did participated in the most number of Tournament competitions?
Additional table information: table: sports_competition
SQL: 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?
Additional table information: table: sports_competition
SQL: SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
which countries did participated in both Friendly and Tournament type competitions.
Additional table information: table: sports_competition
SQL: 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?
Additional table information: table: sports_competition
SQL: SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament'
Find the countries that have never participated in any competition with Friendly type.
Additional table information: table: sports_competition
SQL: 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?
Additional table information: table: sports_competition
SQL: SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly'
How many furniture components are there in total?
Additional table information: table: manufacturer
SQL: SELECT SUM(num_of_component) FROM furniture
Return the name and id of the furniture with the highest market rate.
Additional table information: table: manufacturer
SQL: SELECT name, furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1
find the total market rate of the furnitures that have the top 2 market shares.
Additional table information: table: manufacturer
SQL: SELECT SUM(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2
Find the component amounts and names of all furnitures that have more than 10 components.
Additional table information: table: manufacturer
SQL: SELECT Num_of_Component, name FROM furniture WHERE Num_of_Component > 10
Find the name and component amount of the least popular furniture.
Additional table information: table: manufacturer
SQL: SELECT name, Num_of_Component FROM furniture ORDER BY market_rate NULLS FIRST LIMIT 1
Find the names of furnitures whose prices are lower than the highest price.
Additional table information: table: manufacturer
SQL: 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)
Which manufacturer has the most number of shops? List its name and year of opening.
Additional table information: table: manufacturer
SQL: SELECT open_year, name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1
Find the average number of factories for the manufacturers that have more than 20 shops.
Additional table information: table: manufacturer
SQL: SELECT AVG(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20
List all manufacturer names and ids ordered by their opening year.
Additional table information: table: manufacturer
SQL: SELECT name, manufacturer_id FROM manufacturer ORDER BY open_year NULLS FIRST
Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops.
Additional table information: table: manufacturer
SQL: SELECT name, open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10