minktn/spider-data huggingface dataset:
Database: college_1
Question: What is the number of professors for different school?
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
Database: college_1
Question: How many different professors are there for the different schools?
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
Database: college_1
Question: Find the count and code of the job has most employees.
SQL: SELECT emp_jobcode ,  count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1
Database: college_1
Question: What is the count and code of the job with the most employee?
SQL: SELECT emp_jobcode ,  count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1
Database: college_1
Question: Which school has the smallest amount of professors?
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(*) LIMIT 1
Database: college_1
Question: Which school has the fewest professors?
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(*) LIMIT 1
Database: college_1
Question: Find the number of professors with a Ph.D. degree in each department.
SQL: SELECT count(*) ,  dept_code FROM professor WHERE prof_high_degree  =  'Ph.D.' GROUP BY dept_code
Database: college_1
Question: How many professors have a Ph.D. in each department?
SQL: SELECT count(*) ,  dept_code FROM professor WHERE prof_high_degree  =  'Ph.D.' GROUP BY dept_code
Database: college_1
Question: Find the number of students for each department.
SQL: SELECT count(*) ,  dept_code FROM student GROUP BY dept_code
Database: college_1
Question: How many students are in each department?
SQL: SELECT count(*) ,  dept_code FROM student GROUP BY dept_code
Database: college_1
Question: Find the total number of hours have done for all students in each department.
SQL: SELECT sum(stu_hrs) ,  dept_code FROM student GROUP BY dept_code
Database: college_1
Question: How many hours do the students spend studying in each department?
SQL: SELECT sum(stu_hrs) ,  dept_code FROM student GROUP BY dept_code
Database: college_1
Question: Find the max, average, and minimum gpa of all students in each department.
SQL: SELECT max(stu_gpa) ,  avg(stu_gpa) ,  min(stu_gpa) ,  dept_code FROM student GROUP BY dept_code
Database: college_1
Question: What is the highest, lowest, and average student GPA for every department?
SQL: SELECT max(stu_gpa) ,  avg(stu_gpa) ,  min(stu_gpa) ,  dept_code FROM student GROUP BY dept_code
Database: college_1
Question: What is the name and the average gpa of department whose students have the highest average gpa?
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
Database: college_1
Question: Which department has the highest average student GPA, and what is the average gpa?
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
Database: college_1
Question: how many schools exist in total?
SQL: SELECT count(DISTINCT school_code) FROM department
Database: college_1
Question: How many schools are there in the department?
SQL: SELECT count(DISTINCT school_code) FROM department
Database: college_1
Question: How many different classes are there?
SQL: SELECT count(DISTINCT class_code) FROM CLASS
Database: college_1
Question: How many unique classes are offered?
SQL: SELECT count(DISTINCT class_code) FROM CLASS
Database: college_1
Question: How many courses are offered?
SQL: SELECT count(DISTINCT crs_code) FROM CLASS
Database: college_1
Question: What are the number of different course codes?
SQL: SELECT count(DISTINCT crs_code) FROM CLASS
Database: college_1
Question: How many departments does the college has?
SQL: SELECT count(DISTINCT dept_name) FROM department
Database: college_1
Question: How many different departments are there?
SQL: SELECT count(DISTINCT dept_name) FROM department
Database: college_1
Question: How many courses are offered by the Computer Info. Systems department?
SQL: SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code  =  T2.dept_code WHERE dept_name  =  "Computer Info. Systems"
Database: college_1
Question: How many courses does the department of Computer Information Systmes offer?
SQL: SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code  =  T2.dept_code WHERE dept_name  =  "Computer Info. Systems"
Database: college_1
Question: How many sections does course ACCT-211 has?
SQL: SELECT count(DISTINCT class_section) FROM CLASS WHERE crs_code  =  'ACCT-211'
Database: college_1
Question: What is the number of different class sections offered in the course ACCT-211?
SQL: SELECT count(DISTINCT class_section) FROM CLASS WHERE crs_code  =  'ACCT-211'
Database: college_1
Question: Find the total credits of all classes offered by each department.
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
Database: college_1
Question: What are the total number of credits offered by each department?
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
Database: college_1
Question: Find the name of the department that offers the largest number of credits of all classes.
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
Database: college_1
Question: Which department offers the most credits all together?
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
Database: college_1
Question: How many students enrolled in class ACCT-211?
SQL: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code WHERE T1.crs_code  =  'ACCT-211'
Database: college_1
Question: What are the total number of students enrolled in ACCT-211?
SQL: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code WHERE T1.crs_code  =  'ACCT-211'
Database: college_1
Question: What is the first name of each student enrolled in class ACCT-211?
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'
Database: college_1
Question: What are the first names of all students in course ACCT-211?
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'
Database: college_1
Question: What is the first name of students enrolled in class ACCT-211 and got grade C?
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'
Database: college_1
Question: What are the first names of all students who took ACCT-211 and received a C?
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'
Database: college_1
Question: Find the total number of employees.
SQL: SELECT count(*) FROM employee
Database: college_1
Question: How many employees are there all together?
SQL: SELECT count(*) FROM employee
Database: college_1
Question: How many professors do have a Ph.D. degree?
SQL: SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.'
Database: college_1
Question: What is the total number of professors with a Ph.D. ?
SQL: SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.'
Database: college_1
Question: How many students are enrolled in the class taught by some professor from the accounting department?
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'
Database: college_1
Question: How many students are enrolled in some classes that are taught by an accounting professor?
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'
Database: college_1
Question: What is the name of the department that has the largest number of students enrolled?
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
Database: college_1
Question: What is the name of the department with the most students enrolled?
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
Database: college_1
Question: list names of all departments ordered by their names.
SQL: SELECT dept_name FROM department ORDER BY dept_name
Database: college_1
Question: What are the names of all departments in alphabetical order?
SQL: SELECT dept_name FROM department ORDER BY dept_name
Database: college_1
Question: List the codes of all courses that take place in room KLR209.
SQL: SELECT class_code FROM CLASS WHERE class_room  =  'KLR209'
Database: college_1
Question: What are the codes of all the courses that are located in room KLR209?
SQL: SELECT class_code FROM CLASS WHERE class_room  =  'KLR209'
Database: college_1
Question: List the first name of all employees with job code PROF ordered by their date of birth.
SQL: SELECT emp_fname FROM employee WHERE emp_jobcode  =  'PROF' ORDER BY emp_dob
Database: college_1
Question: What are the first names of all employees that are professors ordered by date of birth?
SQL: SELECT emp_fname FROM employee WHERE emp_jobcode  =  'PROF' ORDER BY emp_dob
Database: college_1
Question: Find the first names and offices of all professors sorted by alphabetical order of their first name.
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
Database: college_1
Question: What are the first names and office locations for all professors sorted alphabetically by first name?
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
Database: college_1
Question: What is the first and last name of the oldest employee?
SQL: SELECT emp_fname ,  emp_lname FROM employee ORDER BY emp_dob LIMIT 1
Database: college_1
Question: What are the first and last names of the employee with the earliest date of birth?
SQL: SELECT emp_fname ,  emp_lname FROM employee ORDER BY emp_dob LIMIT 1
Database: college_1
Question: What is the first, last name, gpa of the youngest one among students whose GPA is above 3?
SQL: SELECT stu_fname ,  stu_lname ,  stu_gpa FROM student WHERE stu_gpa  >  3 ORDER BY stu_dob DESC LIMIT 1
Database: college_1
Question: What is the first and last name of the youngest student with a GPA above 3, and what is their GPA?
SQL: SELECT stu_fname ,  stu_lname ,  stu_gpa FROM student WHERE stu_gpa  >  3 ORDER BY stu_dob DESC LIMIT 1
Database: college_1
Question: What is the first name of students who got grade C in any class?
SQL: SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num WHERE enroll_grade  =  'C'
Database: college_1
Question: What are the first names of all students who got a grade C in a class?
SQL: SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num WHERE enroll_grade  =  'C'
Database: college_1
Question: What is the name of department where has the smallest number of professors?
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(*) LIMIT 1
Database: college_1
Question: What is the name of the department with the fewest professors?
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(*) LIMIT 1
Database: college_1
Question: What is the name of department where has the largest number of professors with a Ph.D. degree?
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
Database: college_1
Question: Which department has the most professors with a Ph.D.?
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
Database: college_1
Question: What are the first names of the professors who do not teach a class.
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
Database: college_1
Question: What are the first names of all professors not teaching any classes?
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
Database: college_1
Question: What is the first names of the professors from the history department who do not teach a class.
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
Database: college_1
Question: What are the first names of all history professors who do not teach?
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
Database: college_1
Question: What is the last name and office of the professor from the history department?
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'
Database: college_1
Question: What are the last name and office of all history professors?
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'
Database: college_1
Question: What is department name and office for the professor whose last name is Heffington?
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'
Database: college_1
Question: What is the name of the department and office location for the professor with the last name of Heffington?
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'
Database: college_1
Question: Find the last name and hire date of the professor who is in office DRE 102.
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'
Database: college_1
Question: What is the last name of the professor whose office is located in DRE 102, and when were they hired?
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'
Database: college_1
Question: What is the code of the course which the student whose last name is Smithson took?
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'
Database: college_1
Question: What are the course codes for every class that the student with the last name Smithson took?
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'
Database: college_1
Question: What are the description and credit of the course which the student whose last name is Smithson took?
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'
Database: college_1
Question: How many credits is the course that the student with the last name Smithson took, and what is its description?
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'
Database: college_1
Question: How many professors who has a either Ph.D. or MA degree?
SQL: SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.' OR prof_high_degree  =  'MA'
Database: college_1
Question: How many professors attained either Ph.D. or Masters degrees?
SQL: SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.' OR prof_high_degree  =  'MA'
Database: college_1
Question: How many professors who are from either Accounting or Biology department?
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'
Database: college_1
Question: What is the number of professors who are in the Accounting or Biology departments?
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'
Database: college_1
Question: Find the first name of the professor who is teaching two courses with code CIS-220 and QM-261.
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'
Database: college_1
Question: What is the first name of the professor who is teaching CIS-220 and QM-261?
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'
Database: college_1
Question: Find the first name of student who is taking classes from accounting and Computer Info. Systems departments
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'
Database: college_1
Question: What are the first names of all students taking accoutning and Computer Information Systems classes?
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'
Database: college_1
Question: What is the average gpa of the students enrolled in the course with code ACCT-211?
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'
Database: college_1
Question: What is the average GPA of students taking ACCT-211?
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'
Database: college_1
Question: What is the first name, gpa and phone number of the top 5 students with highest gpa?
SQL: SELECT stu_gpa ,  stu_phone ,  stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5
Database: college_1
Question: What is the first name, GPA, and phone number of the students with the top 5 GPAs?
SQL: SELECT stu_gpa ,  stu_phone ,  stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5
Database: college_1
Question: What is the department name of the students with lowest gpa belongs to?
SQL: 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
Database: college_1
Question: What is the name of the department with the student that has the lowest GPA?
SQL: 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
Database: college_1
Question: Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.
SQL: SELECT stu_fname ,  stu_gpa FROM student WHERE stu_gpa  <  (SELECT avg(stu_gpa) FROM student)
Database: college_1
Question: What is the first name and GPA of every student that has a GPA lower than average?
SQL: SELECT stu_fname ,  stu_gpa FROM student WHERE stu_gpa  <  (SELECT avg(stu_gpa) FROM student)
Database: college_1
Question: Find the name and address of the department that has the highest number of students.
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
Database: college_1
Question: What is the name and address of the department with the most students?
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
Database: college_1
Question: Find the name, address, number of students in the departments that have the top 3 highest number of students.
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
Database: college_1
Question: What is the name, address, and number of students in the departments that have the 3 most students?
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
Database: college_1
Question: Find the first name and office of the professor who is in the history department and has a Ph.D. degree.
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.'
Database: college_1
Question: What are the first names and office of the professors who are in the history department and have a Ph.D?
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.'
Database: college_1
Question: Find the first names of all instructors who have taught some course and the course code.
SQL: SELECT T2.emp_fname ,  T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num  =  T2.emp_num
Database: college_1
Question: What are the first names of all teachers who have taught a course and the corresponding course codes?
SQL: SELECT T2.emp_fname ,  T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num  =  T2.emp_num
Database: college_1
Question: Find the first names of all instructors who have taught some course and the course description.
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
Database: college_1
Question: What are the first names of all teachers who have taught a course and the corresponding descriptions?
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
Database: college_1
Question: Find the first names and offices of all instructors who have taught some course and also find the course description.
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
Database: college_1
Question: What are the first names, office locations of all lecturers who have taught some course?
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
Database: college_1
Question: Find the first names and offices of all instructors who have taught some course and the course description and the department name.
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
Database: college_1
Question: What are the first names, office locations, and departments of all instructors, and also what are the descriptions of the courses they teach?
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
Database: college_1
Question: Find names of all students who took some course and the course description.
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
Database: college_1
Question: What are the names of all students who took a class and the corresponding course descriptions?
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
Database: college_1
Question: Find names of all students who took some course and got A or C.
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'
Database: college_1
Question: What are the names of all students taking a course who received an A or C?
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'
Database: college_1
Question: Find the first names of all professors in the Accounting department who is teaching some course and the class room.
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'
Database: college_1
Question: What are the first names of all Accounting professors who teach and what are the classrooms of the courses they teach?
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'
Database: college_1
Question: Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department.
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'
Database: college_1
Question: What are the different first names and highest degree attained for professors teaching in the Computer Information Systems department?
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'
Database: college_1
Question: What is the last name of the student who got a grade A in the class with code 10018.
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
Database: college_1
Question: What is the last name of the student who received an A in the class with the code 10018?
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
Database: college_1
Question: Find the first name and office of history professor who did not get a Ph.D. degree.
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.'
Database: college_1
Question: What are the first names and offices of history professors who don't have Ph.D.s?
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.'
Database: college_1
Question: Find the first names of professors who are teaching more than one class.
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
Database: college_1
Question: What are the first names of all professors who teach more than one class?
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
Database: college_1
Question: Find the first names of students who took exactly one class.
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
Database: college_1
Question: What are the first names of student who only took one course?
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
Database: college_1
Question: Find the name of department that offers the class whose description has the word "Statistics".
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%'
Database: college_1
Question: What is the name of the department that offers a course that has a description including the word "Statistics"?
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%'
Database: college_1
Question: What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class?
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%'
Database: college_1
Question: What is the first name of the student whose last name starts with the letter S and is taking ACCT-211?
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%'
Database: sports_competition
Question: How many clubs are there?
SQL: SELECT count(*) FROM club
Database: sports_competition
Question: What is the total number of clubs?
SQL: SELECT count(*) FROM club
Database: sports_competition
Question: List the distinct region of clubs in ascending alphabetical order.
SQL: SELECT DISTINCT Region FROM club ORDER BY Region ASC
Database: sports_competition
Question: What are the different regions of clubs in ascending alphabetical order?
SQL: SELECT DISTINCT Region FROM club ORDER BY Region ASC
Database: sports_competition
Question: What is the average number of gold medals for clubs?
SQL: SELECT avg(Gold) FROM club_rank
Database: sports_competition
Question: What is the average number of gold medals for a club?
SQL: SELECT avg(Gold) FROM club_rank
Database: sports_competition
Question: What are the types and countries of competitions?
SQL: SELECT Competition_type ,  Country FROM competition
Database: sports_competition
Question: What are the types of every competition and in which countries are they located?
SQL: SELECT Competition_type ,  Country FROM competition
Database: sports_competition
Question: What are the distinct years in which the competitions type is not "Tournament"?
SQL: SELECT DISTINCT YEAR FROM competition WHERE Competition_type != "Tournament"
Database: sports_competition
Question: What are the different years for all competitions that are not of type equal to tournament?
SQL: SELECT DISTINCT YEAR FROM competition WHERE Competition_type != "Tournament"
Database: sports_competition
Question: What are the maximum and minimum number of silver medals for clubs.
SQL: SELECT max(Silver) ,  min(Silver) FROM club_rank
Database: sports_competition
Question: What are the maximum and minimum number of silver medals for all the clubs?
SQL: SELECT max(Silver) ,  min(Silver) FROM club_rank
Database: sports_competition
Question: How many clubs have total medals less than 10?
SQL: SELECT count(*) FROM club_rank WHERE Total  <  10
Database: sports_competition
Question: What is the total number of clubs that have less than 10 medals in total?
SQL: SELECT count(*) FROM club_rank WHERE Total  <  10
Database: sports_competition
Question: List all club names in ascending order of start year.
SQL: SELECT name FROM club ORDER BY Start_year ASC
Database: sports_competition
Question: What are the names of all the clubs starting with the oldest?
SQL: SELECT name FROM club ORDER BY Start_year ASC
Database: sports_competition
Question: List all club names in descending alphabetical order.
SQL: SELECT name FROM club ORDER BY name DESC
Database: sports_competition
Question: What are the names of all the clubs ordered in descending alphabetical order?
SQL: SELECT name FROM club ORDER BY name DESC
Database: sports_competition
Question: Please show the names and the players of clubs.
SQL: SELECT T1.name ,  T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID
Database: sports_competition
Question: What are the names and players of all the clubs?
SQL: SELECT T1.name ,  T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID
Database: sports_competition
Question: Show the names of clubs that have players with position "Right Wing".
SQL: SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T2.Position  =  "Right Wing"
Database: sports_competition
Question: What are the names of the clubs that have players in the position of "Right Wing"?
SQL: SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T2.Position  =  "Right Wing"
Database: sports_competition
Question: What is the average points of players from club with name "AIB".
SQL: SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T1.name  =  "AIB"
Database: sports_competition
Question: What is the average number of points for players from the "AIB" club?
SQL: SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T1.name  =  "AIB"
Database: sports_competition
Question: List the position of players and the average number of points of players of each position.
SQL: SELECT POSITION ,  avg(Points) FROM player GROUP BY POSITION
Database: sports_competition
Question: For each position, what is the average number of points for players in that position?
SQL: SELECT POSITION ,  avg(Points) FROM player GROUP BY POSITION
Database: sports_competition
Question: List the position of players with average number of points scored by players of that position bigger than 20.
SQL: SELECT POSITION FROM player GROUP BY name HAVING avg(Points)  >=  20
Database: sports_competition
Question: What are the positions of players whose average number of points scored by that position is larger than 20?
SQL: SELECT POSITION FROM player GROUP BY name HAVING avg(Points)  >=  20
Database: sports_competition
Question: List the types of competition and the number of competitions of each type.
SQL: SELECT Competition_type ,  COUNT(*) FROM competition GROUP BY Competition_type
Database: sports_competition
Question: What are the types of competition and number of competitions for that type?
SQL: SELECT Competition_type ,  COUNT(*) FROM competition GROUP BY Competition_type
Database: sports_competition
Question: List the most common type of competition.
SQL: SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1
Database: sports_competition
Question: What is the most common competition type?
SQL: SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1
Database: sports_competition
Question: List the types of competition that have at most five competitions of that type.
SQL: SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*)  <=  5
Database: sports_competition
Question: What are the types of competition that have most 5 competitions for that type?
SQL: SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*)  <=  5
Database: sports_competition
Question: List the names of clubs that do not have any players.
SQL: SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player)
Database: sports_competition
Question: What are the names of all clubs that do not have any players?
SQL: SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player)
Database: sports_competition
Question: What are the positions with both players having more than 20 points and less than 10 points.
SQL: SELECT POSITION FROM player WHERE Points  >  20 INTERSECT SELECT POSITION FROM player WHERE Points  <  10
Database: sports_competition
Question: What are the positions of both players that have more than 20 20 points and less than 10 points?
SQL: SELECT POSITION FROM player WHERE Points  >  20 INTERSECT SELECT POSITION FROM player WHERE Points  <  10
Database: sports_competition
Question: Show total points of all players.
SQL: SELECT sum(Points) FROM player
Database: sports_competition
Question: What is the total number of points for all players?
SQL: SELECT sum(Points) FROM player
Database: sports_competition
Question: how many different positions are there?
SQL: SELECT count(DISTINCT POSITION) FROM player
Database: sports_competition
Question: How many different position for players are listed?
SQL: SELECT count(DISTINCT POSITION) FROM player
Database: sports_competition
Question: what are the name of players who get more than the average points.
SQL: SELECT name FROM player WHERE points  >  (SELECT avg(points) FROM player)
Database: sports_competition
Question: What are the names of all players that got more than the average number of points?
SQL: SELECT name FROM player WHERE points  >  (SELECT avg(points) FROM player)
Database: sports_competition
Question: find the number of players whose points are lower than 30 in each position.
SQL: SELECT count(*) ,  POSITION FROM player WHERE points  <  30 GROUP BY POSITION
Database: sports_competition
Question: What is the number of players who have points less than 30 for each position?
SQL: SELECT count(*) ,  POSITION FROM player WHERE points  <  30 GROUP BY POSITION
Database: sports_competition
Question: which country did participated in the most number of Tournament competitions?
SQL: SELECT country FROM competition WHERE competition_type  =  'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1
Database: sports_competition
Question: what is the name of the country that participated in the most tournament competitions?
SQL: SELECT country FROM competition WHERE competition_type  =  'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1
Database: sports_competition
Question: which countries did participated in both Friendly and Tournament type competitions.
SQL: SELECT country FROM competition WHERE competition_type  =  'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type  =  'Tournament'
Database: sports_competition
Question: What are the countries that participated in both friendly and tournament type competitions?
SQL: SELECT country FROM competition WHERE competition_type  =  'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type  =  'Tournament'
Database: sports_competition
Question: Find the countries that have never participated in any competition with Friendly type.
SQL: SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type  =  'Friendly'
Database: sports_competition
Question: What are the countries that have never participated in any friendly-type competitions?
SQL: SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type  =  'Friendly'
Database: manufacturer
Question: How many furniture components are there in total?
SQL: SELECT sum(num_of_component) FROM furniture
Database: manufacturer
Question: Return the name and id of the furniture with the highest market rate.
SQL: SELECT name ,  furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1
Database: manufacturer
Question: find the total market rate of the furnitures that have the top 2 market shares.
SQL: SELECT sum(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2
Database: manufacturer
Question: Find the component amounts and names of all furnitures that have more than 10 components.
SQL: SELECT Num_of_Component ,  name FROM furniture WHERE Num_of_Component  >  10
Database: manufacturer
Question: Find the name and component amount of the least popular furniture.
SQL: SELECT name ,  Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1
Database: manufacturer
Question: Find the names of furnitures whose prices are lower than the highest price.
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)
Database: manufacturer
Question: Which manufacturer has the most number of shops? List its name and year of opening.
SQL: SELECT open_year ,  name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1
Database: manufacturer
Question: Find the average number of factories for the manufacturers that have more than 20 shops.
SQL: SELECT avg(Num_of_Factories) FROM manufacturer WHERE num_of_shops  >  20
Database: manufacturer
Question: List all manufacturer names and ids ordered by their opening year.
SQL: SELECT name ,  manufacturer_id FROM manufacturer ORDER BY open_year
Database: manufacturer
Question: Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops.
SQL: SELECT name ,  open_year FROM manufacturer WHERE num_of_shops  >  10 OR Num_of_Factories  <  10
Database: manufacturer
Question: what is the average number of factories and maximum number of shops for manufacturers that opened before 1990.
SQL: SELECT max(num_of_shops) ,  avg(Num_of_Factories) FROM manufacturer WHERE open_year  <  1990
Database: manufacturer
Question: Find the id and number of shops for the company that produces the most expensive furniture.
SQL: SELECT t1.manufacturer_id ,  t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id  =  t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1
Database: manufacturer
Question: Find the number of funiture types produced by each manufacturer as well as the company names.
SQL: SELECT count(*) ,  t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id  =  t2.manufacturer_id GROUP BY t1.manufacturer_id
Database: manufacturer
Question: Give me the names and prices of furnitures which some companies are manufacturing.
SQL: SELECT t1.name ,  t2.price_in_dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID  =  t2.Furniture_ID
Database: manufacturer
Question: Find the market shares and names of furnitures which no any company is producing in our records.
SQL: SELECT Market_Rate ,  name FROM furniture WHERE Furniture_ID NOT IN (SELECT Furniture_ID FROM furniture_manufacte)
Database: manufacturer
Question: Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components.
SQL: SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID  =  t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id  =  t3.manufacturer_id WHERE t1.num_of_component  <  6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID  =  t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id  =  t3.manufacturer_id WHERE t1.num_of_component  >  10
Database: hr_1
Question: Display the first name and department name for each employee.
SQL: SELECT T1.first_name ,  T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id
Database: hr_1
Question: What are the first name and department name of all employees?
SQL: SELECT T1.first_name ,  T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id
Database: hr_1
Question: List the full name (first and last name), and salary for those employees who earn below 6000.
SQL: SELECT first_name ,  last_name ,  salary FROM employees WHERE salary  <  6000
Database: hr_1
Question: What are the full names and salaries for any employees earning less than 6000?
SQL: SELECT first_name ,  last_name ,  salary FROM employees WHERE salary  <  6000
Database: hr_1
Question: Display the first name, and department number for all employees whose last name is "McEwen".
SQL: SELECT first_name ,  department_id FROM employees WHERE last_name  =  'McEwen'
Database: hr_1
Question: What are the first names and department numbers for employees with last name McEwen?
SQL: SELECT first_name ,  department_id FROM employees WHERE last_name  =  'McEwen'
Database: hr_1
Question: Return all the information for all employees without any department number.
SQL: SELECT * FROM employees WHERE department_id  =  "null"