input stringlengths 667 7.62k | output stringlengths 41 600 | db_id stringlengths 3 31 | query stringlengths 18 577 | question stringlengths 3 224 | schema stringlengths 177 6.14k | primary_keys stringlengths 16 545 | foreign_keys stringlengths 16 1.48k |
|---|---|---|---|---|---|---|---|
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the department with the student that has the lowest GPA?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1</SQL_QUERY> | college_1 | SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1 | What is the name of the department with the student that has the lowest GPA? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.</question>
[SQL]:
| <SQL_QUERY>SELECT stu_fname , stu_gpa FROM student WHERE stu_gpa < (SELECT avg(stu_gpa) FROM student)</SQL_QUERY> | college_1 | SELECT stu_fname , stu_gpa FROM student WHERE stu_gpa < (SELECT avg(stu_gpa) FROM student) | Find the first name and gpa of the students whose gpa is lower than the average gpa of all students. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the first name and GPA of every student that has a GPA lower than average?</question>
[SQL]:
| <SQL_QUERY>SELECT stu_fname , stu_gpa FROM student WHERE stu_gpa < (SELECT avg(stu_gpa) FROM student)</SQL_QUERY> | college_1 | SELECT stu_fname , stu_gpa FROM student WHERE stu_gpa < (SELECT avg(stu_gpa) FROM student) | What is the first name and GPA of every student that has a GPA lower than average? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name and address of the department that has the highest number of students.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.dept_name , T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | college_1 | SELECT T2.dept_name , T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1 | Find the name and address of the department that has the highest number of students. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name and address of the department with the most students?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.dept_name , T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | college_1 | SELECT T2.dept_name , T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1 | What is the name and address of the department with the most students? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name, address, number of students in the departments that have the top 3 highest number of students.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3</SQL_QUERY> | college_1 | SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3 | Find the name, address, number of students in the departments that have the top 3 highest number of students. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name, address, and number of students in the departments that have the 3 most students?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3</SQL_QUERY> | college_1 | SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3 | What is the name, address, and number of students in the departments that have the 3 most students? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first name and office of the professor who is in the history department and has a Ph.D. degree.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.emp_fname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'</SQL_QUERY> | college_1 | SELECT T1.emp_fname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.' | Find the first name and office of the professor who is in the history department and has a Ph.D. degree. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names and office of the professors who are in the history department and have a Ph.D?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.emp_fname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'</SQL_QUERY> | college_1 | SELECT T1.emp_fname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.' | What are the first names and office of the professors who are in the history department and have a Ph.D? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first names of all instructors who have taught some course and the course code.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num | Find the first names of all instructors who have taught some course and the course code. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names of all teachers who have taught a course and the corresponding course codes?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num | What are the first names of all teachers who have taught a course and the corresponding course codes? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first names of all instructors who have taught some course and the course description.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code | Find the first names of all instructors who have taught some course and the course description. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names of all teachers who have taught a course and the corresponding descriptions?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code | What are the first names of all teachers who have taught a course and the corresponding descriptions? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first names and offices of all instructors who have taught some course and also find the course description.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T4.prof_office , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T4.prof_office , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num | Find the first names and offices of all instructors who have taught some course and also find the course description. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names, office locations of all lecturers who have taught some course?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T4.prof_office , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T4.prof_office , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num | What are the first names, office locations of all lecturers who have taught some course? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first names and offices of all instructors who have taught some course and the course description and the department name.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T4.prof_office , T3.crs_description , T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T4.prof_office , T3.crs_description , T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code | Find the first names and offices of all instructors who have taught some course and the course description and the department name. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names, office locations, and departments of all instructors, and also what are the descriptions of the courses they teach?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T4.prof_office , T3.crs_description , T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T4.prof_office , T3.crs_description , T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code | What are the first names, office locations, and departments of all instructors, and also what are the descriptions of the courses they teach? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find names of all students who took some course and the course description.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stu_fname , T1.stu_lname , T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code</SQL_QUERY> | college_1 | SELECT T1.stu_fname , T1.stu_lname , T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code | Find names of all students who took some course and the course description. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all students who took a class and the corresponding course descriptions?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stu_fname , T1.stu_lname , T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code</SQL_QUERY> | college_1 | SELECT T1.stu_fname , T1.stu_lname , T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code | What are the names of all students who took a class and the corresponding course descriptions? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find names of all students who took some course and got A or C.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stu_fname , T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'</SQL_QUERY> | college_1 | SELECT T1.stu_fname , T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A' | Find names of all students who took some course and got A or C. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all students taking a course who received an A or C?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stu_fname , T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'</SQL_QUERY> | college_1 | SELECT T1.stu_fname , T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A' | What are the names of all students taking a course who received an A or C? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first names of all professors in the Accounting department who is teaching some course and the class room.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting' | Find the first names of all professors in the Accounting department who is teaching some course and the class room. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names of all Accounting professors who teach and what are the classrooms of the courses they teach?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting' | What are the first names of all Accounting professors who teach and what are the classrooms of the courses they teach? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department.</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT T2.emp_fname , T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'</SQL_QUERY> | college_1 | SELECT DISTINCT T2.emp_fname , T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems' | Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the different first names and highest degree attained for professors teaching in the Computer Information Systems department?</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT T2.emp_fname , T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'</SQL_QUERY> | college_1 | SELECT DISTINCT T2.emp_fname , T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems' | What are the different first names and highest degree attained for professors teaching in the Computer Information Systems department? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the last name of the student who got a grade A in the class with code 10018.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018</SQL_QUERY> | college_1 | SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018 | What is the last name of the student who got a grade A in the class with code 10018. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the last name of the student who received an A in the class with the code 10018?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018</SQL_QUERY> | college_1 | SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018 | What is the last name of the student who received an A in the class with the code 10018? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first name and office of history professor who did not get a Ph.D. degree.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree != 'Ph.D.'</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree != 'Ph.D.' | Find the first name and office of history professor who did not get a Ph.D. degree. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names and offices of history professors who don't have Ph.D.s?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree != 'Ph.D.'</SQL_QUERY> | college_1 | SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree != 'Ph.D.' | What are the first names and offices of history professors who don't have Ph.D.s? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first names of professors who are teaching more than one class.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING count(*) > 1</SQL_QUERY> | college_1 | SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING count(*) > 1 | Find the first names of professors who are teaching more than one class. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names of all professors who teach more than one class?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING count(*) > 1</SQL_QUERY> | college_1 | SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING count(*) > 1 | What are the first names of all professors who teach more than one class? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first names of students who took exactly one class.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING count(*) = 1</SQL_QUERY> | college_1 | SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING count(*) = 1 | Find the first names of students who took exactly one class. | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names of student who only took one course?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING count(*) = 1</SQL_QUERY> | college_1 | SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING count(*) = 1 | What are the first names of student who only took one course? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of department that offers the class whose description has the word "Statistics".</question>
[SQL]:
| <SQL_QUERY>SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%'</SQL_QUERY> | college_1 | SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%' | Find the name of department that offers the class whose description has the word "Statistics". | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the department that offers a course that has a description including the word "Statistics"?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%'</SQL_QUERY> | college_1 | SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%' | What is the name of the department that offers a course that has a description including the word "Statistics"? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%'</SQL_QUERY> | college_1 | SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%' | What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text);</schema>"
<primary_keys>[Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num</primary_keys>"
<foreign_keys>[Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the first name of the student whose last name starts with the letter S and is taking ACCT-211?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%'</SQL_QUERY> | college_1 | SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%' | What is the first name of the student whose last name starts with the letter S and is taking ACCT-211? | [Schema (values) (types)]: | college_1 | CLASS : class_code (text) , crs_code (text) , class_section (text) , class_time (text) , class_room (text) , prof_num (text) | COURSE : crs_code (text) , dept_code (text) , crs_description (text) , crs_credit (text) | DEPARTMENT : dept_code (text) , dept_name (text) , school_code (text) , emp_num (text) , dept_address (text) , dept_extension (text) | EMPLOYEE : emp_num (text) , emp_lname (text) , emp_fname (text) , emp_initial (text) , emp_jobcode (text) , emp_hiredate (text) , emp_dob (number) | ENROLL : class_code (text) , stu_num (text) , enroll_grade (text) | PROFESSOR : emp_num (text) , dept_code (text) , prof_office (text) , prof_extension (text) , prof_high_degree (text) | STUDENT : stu_num (text) , stu_lname (text) , stu_fname (text) , stu_init (text) , stu_dob (text) , stu_hrs (text) , stu_class (number) , stu_gpa (text) , stu_transfer (text) , dept_code (text) , stu_phone (number) , prof_num (text); | [Primary Keys]: class : class_code, course : crs_code, department : dept_code, employee : emp_num, enroll : stu_num | [Foreign Keys]: class : prof_num = employee : emp_num | class : crs_code = course : crs_code | course : dept_code = department : dept_code | department : emp_num = employee : emp_num | enroll : stu_num = student : stu_num | enroll : class_code = class : class_code | professor : dept_code = department : dept_code | professor : emp_num = employee : emp_num | student : dept_code = department : dept_code |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many clubs are there?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM club</SQL_QUERY> | sports_competition | SELECT count(*) FROM club | How many clubs are there? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the total number of clubs?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM club</SQL_QUERY> | sports_competition | SELECT count(*) FROM club | What is the total number of clubs? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the distinct region of clubs in ascending alphabetical order.</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT Region FROM club ORDER BY Region ASC</SQL_QUERY> | sports_competition | SELECT DISTINCT Region FROM club ORDER BY Region ASC | List the distinct region of clubs in ascending alphabetical order. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the different regions of clubs in ascending alphabetical order?</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT Region FROM club ORDER BY Region ASC</SQL_QUERY> | sports_competition | SELECT DISTINCT Region FROM club ORDER BY Region ASC | What are the different regions of clubs in ascending alphabetical order? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average number of gold medals for clubs?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(Gold) FROM club_rank</SQL_QUERY> | sports_competition | SELECT avg(Gold) FROM club_rank | What is the average number of gold medals for clubs? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average number of gold medals for a club?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(Gold) FROM club_rank</SQL_QUERY> | sports_competition | SELECT avg(Gold) FROM club_rank | What is the average number of gold medals for a club? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the types and countries of competitions?</question>
[SQL]:
| <SQL_QUERY>SELECT Competition_type , Country FROM competition</SQL_QUERY> | sports_competition | SELECT Competition_type , Country FROM competition | What are the types and countries of competitions? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the types of every competition and in which countries are they located?</question>
[SQL]:
| <SQL_QUERY>SELECT Competition_type , Country FROM competition</SQL_QUERY> | sports_competition | SELECT Competition_type , Country FROM competition | What are the types of every competition and in which countries are they located? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the distinct years in which the competitions type is not "Tournament"?</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT YEAR FROM competition WHERE Competition_type != "Tournament"</SQL_QUERY> | sports_competition | SELECT DISTINCT YEAR FROM competition WHERE Competition_type != "Tournament" | What are the distinct years in which the competitions type is not "Tournament"? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the different years for all competitions that are not of type equal to tournament?</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT YEAR FROM competition WHERE Competition_type != "Tournament"</SQL_QUERY> | sports_competition | SELECT DISTINCT YEAR FROM competition WHERE Competition_type != "Tournament" | What are the different years for all competitions that are not of type equal to tournament? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the maximum and minimum number of silver medals for clubs.</question>
[SQL]:
| <SQL_QUERY>SELECT max(Silver) , min(Silver) FROM club_rank</SQL_QUERY> | sports_competition | SELECT max(Silver) , min(Silver) FROM club_rank | What are the maximum and minimum number of silver medals for clubs. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the maximum and minimum number of silver medals for all the clubs?</question>
[SQL]:
| <SQL_QUERY>SELECT max(Silver) , min(Silver) FROM club_rank</SQL_QUERY> | sports_competition | SELECT max(Silver) , min(Silver) FROM club_rank | What are the maximum and minimum number of silver medals for all the clubs? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many clubs have total medals less than 10?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM club_rank WHERE Total < 10</SQL_QUERY> | sports_competition | SELECT count(*) FROM club_rank WHERE Total < 10 | How many clubs have total medals less than 10? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the total number of clubs that have less than 10 medals in total?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM club_rank WHERE Total < 10</SQL_QUERY> | sports_competition | SELECT count(*) FROM club_rank WHERE Total < 10 | What is the total number of clubs that have less than 10 medals in total? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List all club names in ascending order of start year.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM club ORDER BY Start_year ASC</SQL_QUERY> | sports_competition | SELECT name FROM club ORDER BY Start_year ASC | List all club names in ascending order of start year. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all the clubs starting with the oldest?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM club ORDER BY Start_year ASC</SQL_QUERY> | sports_competition | SELECT name FROM club ORDER BY Start_year ASC | What are the names of all the clubs starting with the oldest? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List all club names in descending alphabetical order.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM club ORDER BY name DESC</SQL_QUERY> | sports_competition | SELECT name FROM club ORDER BY name DESC | List all club names in descending alphabetical order. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all the clubs ordered in descending alphabetical order?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM club ORDER BY name DESC</SQL_QUERY> | sports_competition | SELECT name FROM club ORDER BY name DESC | What are the names of all the clubs ordered in descending alphabetical order? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Please show the names and the players of clubs.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID</SQL_QUERY> | sports_competition | SELECT T1.name , T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID | Please show the names and the players of clubs. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names and players of all the clubs?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID</SQL_QUERY> | sports_competition | SELECT T1.name , T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID | What are the names and players of all the clubs? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the names of clubs that have players with position "Right Wing".</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing"</SQL_QUERY> | sports_competition | SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing" | Show the names of clubs that have players with position "Right Wing". | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the clubs that have players in the position of "Right Wing"?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing"</SQL_QUERY> | sports_competition | SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing" | What are the names of the clubs that have players in the position of "Right Wing"? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average points of players from club with name "AIB".</question>
[SQL]:
| <SQL_QUERY>SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "AIB"</SQL_QUERY> | sports_competition | SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "AIB" | What is the average points of players from club with name "AIB". | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average number of points for players from the "AIB" club?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "AIB"</SQL_QUERY> | sports_competition | SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "AIB" | What is the average number of points for players from the "AIB" club? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the position of players and the average number of points of players of each position.</question>
[SQL]:
| <SQL_QUERY>SELECT POSITION , avg(Points) FROM player GROUP BY POSITION</SQL_QUERY> | sports_competition | SELECT POSITION , avg(Points) FROM player GROUP BY POSITION | List the position of players and the average number of points of players of each position. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>For each position, what is the average number of points for players in that position?</question>
[SQL]:
| <SQL_QUERY>SELECT POSITION , avg(Points) FROM player GROUP BY POSITION</SQL_QUERY> | sports_competition | SELECT POSITION , avg(Points) FROM player GROUP BY POSITION | For each position, what is the average number of points for players in that position? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the position of players with average number of points scored by players of that position bigger than 20.</question>
[SQL]:
| <SQL_QUERY>SELECT POSITION FROM player GROUP BY name HAVING avg(Points) >= 20</SQL_QUERY> | sports_competition | SELECT POSITION FROM player GROUP BY name HAVING avg(Points) >= 20 | List the position of players with average number of points scored by players of that position bigger than 20. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the positions of players whose average number of points scored by that position is larger than 20?</question>
[SQL]:
| <SQL_QUERY>SELECT POSITION FROM player GROUP BY name HAVING avg(Points) >= 20</SQL_QUERY> | sports_competition | SELECT POSITION FROM player GROUP BY name HAVING avg(Points) >= 20 | What are the positions of players whose average number of points scored by that position is larger than 20? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the types of competition and the number of competitions of each type.</question>
[SQL]:
| <SQL_QUERY>SELECT Competition_type , COUNT(*) FROM competition GROUP BY Competition_type</SQL_QUERY> | sports_competition | SELECT Competition_type , COUNT(*) FROM competition GROUP BY Competition_type | List the types of competition and the number of competitions of each type. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the types of competition and number of competitions for that type?</question>
[SQL]:
| <SQL_QUERY>SELECT Competition_type , COUNT(*) FROM competition GROUP BY Competition_type</SQL_QUERY> | sports_competition | SELECT Competition_type , COUNT(*) FROM competition GROUP BY Competition_type | What are the types of competition and number of competitions for that type? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the most common type of competition.</question>
[SQL]:
| <SQL_QUERY>SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1</SQL_QUERY> | sports_competition | SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1 | List the most common type of competition. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the most common competition type?</question>
[SQL]:
| <SQL_QUERY>SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1</SQL_QUERY> | sports_competition | SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1 | What is the most common competition type? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the types of competition that have at most five competitions of that type.</question>
[SQL]:
| <SQL_QUERY>SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5</SQL_QUERY> | sports_competition | SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5 | List the types of competition that have at most five competitions of that type. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the types of competition that have most 5 competitions for that type?</question>
[SQL]:
| <SQL_QUERY>SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5</SQL_QUERY> | sports_competition | SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5 | What are the types of competition that have most 5 competitions for that type? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the names of clubs that do not have any players.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player)</SQL_QUERY> | sports_competition | SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player) | List the names of clubs that do not have any players. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all clubs that do not have any players?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player)</SQL_QUERY> | sports_competition | SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player) | What are the names of all clubs that do not have any players? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the positions with both players having more than 20 points and less than 10 points.</question>
[SQL]:
| <SQL_QUERY>SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10</SQL_QUERY> | sports_competition | SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10 | What are the positions with both players having more than 20 points and less than 10 points. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the positions of both players that have more than 20 20 points and less than 10 points?</question>
[SQL]:
| <SQL_QUERY>SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10</SQL_QUERY> | sports_competition | SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10 | What are the positions of both players that have more than 20 20 points and less than 10 points? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show total points of all players.</question>
[SQL]:
| <SQL_QUERY>SELECT sum(Points) FROM player</SQL_QUERY> | sports_competition | SELECT sum(Points) FROM player | Show total points of all players. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the total number of points for all players?</question>
[SQL]:
| <SQL_QUERY>SELECT sum(Points) FROM player</SQL_QUERY> | sports_competition | SELECT sum(Points) FROM player | What is the total number of points for all players? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>how many different positions are there?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT POSITION) FROM player</SQL_QUERY> | sports_competition | SELECT count(DISTINCT POSITION) FROM player | how many different positions are there? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many different position for players are listed?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT POSITION) FROM player</SQL_QUERY> | sports_competition | SELECT count(DISTINCT POSITION) FROM player | How many different position for players are listed? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>what are the name of players who get more than the average points.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM player WHERE points > (SELECT avg(points) FROM player)</SQL_QUERY> | sports_competition | SELECT name FROM player WHERE points > (SELECT avg(points) FROM player) | what are the name of players who get more than the average points. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all players that got more than the average number of points?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM player WHERE points > (SELECT avg(points) FROM player)</SQL_QUERY> | sports_competition | SELECT name FROM player WHERE points > (SELECT avg(points) FROM player) | What are the names of all players that got more than the average number of points? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>find the number of players whose points are lower than 30 in each position.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , POSITION FROM player WHERE points < 30 GROUP BY POSITION</SQL_QUERY> | sports_competition | SELECT count(*) , POSITION FROM player WHERE points < 30 GROUP BY POSITION | find the number of players whose points are lower than 30 in each position. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of players who have points less than 30 for each position?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , POSITION FROM player WHERE points < 30 GROUP BY POSITION</SQL_QUERY> | sports_competition | SELECT count(*) , POSITION FROM player WHERE points < 30 GROUP BY POSITION | What is the number of players who have points less than 30 for each position? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>which country did participated in the most number of Tournament competitions?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | sports_competition | SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1 | which country did participated in the most number of Tournament competitions? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>what is the name of the country that participated in the most tournament competitions?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | sports_competition | SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1 | what is the name of the country that participated in the most tournament competitions? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>which countries did participated in both Friendly and Tournament type competitions.</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament'</SQL_QUERY> | sports_competition | SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament' | which countries did participated in both Friendly and Tournament type competitions. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the countries that participated in both friendly and tournament type competitions?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament'</SQL_QUERY> | sports_competition | SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament' | What are the countries that participated in both friendly and tournament type competitions? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the countries that have never participated in any competition with Friendly type.</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly'</SQL_QUERY> | sports_competition | SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly' | Find the countries that have never participated in any competition with Friendly type. | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text);</schema>"
<primary_keys>[Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id</primary_keys>"
<foreign_keys>[Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the countries that have never participated in any friendly-type competitions?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly'</SQL_QUERY> | sports_competition | SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly' | What are the countries that have never participated in any friendly-type competitions? | [Schema (values) (types)]: | sports_competition | club : club_id (text) , name (number) , region (text) , start_year (text) | club_rank : rank (text) , club_id (number) , gold (text) , silver (text) , bronze (text) , total (number) | player : player_id (text) , name (number) , position (text) , club_id (text) , apps (text) , tries (number) , goals (number) , points (number) | competition : competition_id (text) , year (number) , competition_type (text) , country (text) | competition_result : competition_id (text) , club_id_1 (number) , club_id_2 (text) , score (text); | [Primary Keys]: club : club_id, club_rank : rank, player : player_id, competition : competition_id, competition_result : competition_id | [Foreign Keys]: club_rank : club_id = club : club_id | player : club_id = club : club_id | competition_result : competition_id = competition : competition_id | competition_result : club_id_2 = club : club_id | competition_result : club_id_1 = club : club_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number);</schema>"
<primary_keys>[Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id</primary_keys>"
<foreign_keys>[Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many furniture components are there in total?</question>
[SQL]:
| <SQL_QUERY>SELECT sum(num_of_component) FROM furniture</SQL_QUERY> | manufacturer | SELECT sum(num_of_component) FROM furniture | How many furniture components are there in total? | [Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number); | [Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id | [Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number);</schema>"
<primary_keys>[Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id</primary_keys>"
<foreign_keys>[Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Return the name and id of the furniture with the highest market rate.</question>
[SQL]:
| <SQL_QUERY>SELECT name , furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1</SQL_QUERY> | manufacturer | SELECT name , furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1 | Return the name and id of the furniture with the highest market rate. | [Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number); | [Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id | [Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number);</schema>"
<primary_keys>[Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id</primary_keys>"
<foreign_keys>[Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>find the total market rate of the furnitures that have the top 2 market shares.</question>
[SQL]:
| <SQL_QUERY>SELECT sum(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2</SQL_QUERY> | manufacturer | SELECT sum(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2 | find the total market rate of the furnitures that have the top 2 market shares. | [Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number); | [Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id | [Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number);</schema>"
<primary_keys>[Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id</primary_keys>"
<foreign_keys>[Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the component amounts and names of all furnitures that have more than 10 components.</question>
[SQL]:
| <SQL_QUERY>SELECT Num_of_Component , name FROM furniture WHERE Num_of_Component > 10</SQL_QUERY> | manufacturer | SELECT Num_of_Component , name FROM furniture WHERE Num_of_Component > 10 | Find the component amounts and names of all furnitures that have more than 10 components. | [Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number); | [Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id | [Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number);</schema>"
<primary_keys>[Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id</primary_keys>"
<foreign_keys>[Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name and component amount of the least popular furniture.</question>
[SQL]:
| <SQL_QUERY>SELECT name , Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1</SQL_QUERY> | manufacturer | SELECT name , Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1 | Find the name and component amount of the least popular furniture. | [Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number); | [Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id | [Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number);</schema>"
<primary_keys>[Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id</primary_keys>"
<foreign_keys>[Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the names of furnitures whose prices are lower than the highest price.</question>
[SQL]:
| <SQL_QUERY>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)</SQL_QUERY> | manufacturer | SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT max(Price_in_Dollar) FROM furniture_manufacte) | Find the names of furnitures whose prices are lower than the highest price. | [Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number); | [Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id | [Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number);</schema>"
<primary_keys>[Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id</primary_keys>"
<foreign_keys>[Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which manufacturer has the most number of shops? List its name and year of opening.</question>
[SQL]:
| <SQL_QUERY>SELECT open_year , name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1</SQL_QUERY> | manufacturer | SELECT open_year , name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1 | Which manufacturer has the most number of shops? List its name and year of opening. | [Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number); | [Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id | [Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number);</schema>"
<primary_keys>[Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id</primary_keys>"
<foreign_keys>[Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the average number of factories for the manufacturers that have more than 20 shops.</question>
[SQL]:
| <SQL_QUERY>SELECT avg(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20</SQL_QUERY> | manufacturer | SELECT avg(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20 | Find the average number of factories for the manufacturers that have more than 20 shops. | [Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number); | [Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id | [Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number);</schema>"
<primary_keys>[Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id</primary_keys>"
<foreign_keys>[Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List all manufacturer names and ids ordered by their opening year.</question>
[SQL]:
| <SQL_QUERY>SELECT name , manufacturer_id FROM manufacturer ORDER BY open_year</SQL_QUERY> | manufacturer | SELECT name , manufacturer_id FROM manufacturer ORDER BY open_year | List all manufacturer names and ids ordered by their opening year. | [Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number); | [Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id | [Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number);</schema>"
<primary_keys>[Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id</primary_keys>"
<foreign_keys>[Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops.</question>
[SQL]:
| <SQL_QUERY>SELECT name , open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10</SQL_QUERY> | manufacturer | SELECT name , open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10 | Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops. | [Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number); | [Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id | [Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number);</schema>"
<primary_keys>[Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id</primary_keys>"
<foreign_keys>[Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>what is the average number of factories and maximum number of shops for manufacturers that opened before 1990.</question>
[SQL]:
| <SQL_QUERY>SELECT max(num_of_shops) , avg(Num_of_Factories) FROM manufacturer WHERE open_year < 1990</SQL_QUERY> | manufacturer | SELECT max(num_of_shops) , avg(Num_of_Factories) FROM manufacturer WHERE open_year < 1990 | what is the average number of factories and maximum number of shops for manufacturers that opened before 1990. | [Schema (values) (types)]: | manufacturer | manufacturer : manufacturer_id (text) , open_year (number) , name (number) , num_of_factories (text) , num_of_shops (number) | furniture : furniture_id (text) , name (number) , num_of_component (number) , market_rate (text) | furniture_manufacte : manufacturer_id (text) , furniture_id (number) , price_in_dollar (number); | [Primary Keys]: manufacturer : manufacturer_id, furniture : furniture_id, furniture_manufacte : manufacturer_id | [Foreign Keys]: furniture_manufacte : furniture_id = furniture : furniture_id | furniture_manufacte : manufacturer_id = manufacturer : manufacturer_id |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.