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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List each test result and its count in descending order of count.</question>
[SQL]:
| <SQL_QUERY>SELECT test_result , COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC</SQL_QUERY> | e_learning | SELECT test_result , COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC | List each test result and its count in descending order of count. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>For each distinct test result, find the number of students who got the result.</question>
[SQL]:
| <SQL_QUERY>SELECT test_result , COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC</SQL_QUERY> | e_learning | SELECT test_result , COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC | For each distinct test result, find the number of students who got the result. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the login name of the course author that teaches the course with name "advanced database".</question>
[SQL]:
| <SQL_QUERY>SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "advanced database"</SQL_QUERY> | e_learning | SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "advanced database" | Find the login name of the course author that teaches the course with name "advanced database". | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which course author teaches the "advanced database" course? Give me his or her login name.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "advanced database"</SQL_QUERY> | e_learning | SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "advanced database" | Which course author teaches the "advanced database" course? Give me his or her login name. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the addresses of the course authors who teach the course with name "operating system" or "data structure".</question>
[SQL]:
| <SQL_QUERY>SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "operating system" OR T2.course_name = "data structure"</SQL_QUERY> | e_learning | SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "operating system" OR T2.course_name = "data structure" | Find the addresses of the course authors who teach the course with name "operating system" or "data structure". | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the addresses of the course authors who teach either "operating system" or "data structure" course.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "operating system" OR T2.course_name = "data structure"</SQL_QUERY> | e_learning | SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "operating system" OR T2.course_name = "data structure" | What are the addresses of the course authors who teach either "operating system" or "data structure" course. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the personal name, family name, and author ID of the course author that teaches the most courses.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.personal_name , T1.family_name , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1</SQL_QUERY> | e_learning | SELECT T1.personal_name , T1.family_name , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1 | Find the personal name, family name, and author ID of the course author that teaches the most courses. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the personal name, family name, and author ID of the course author who teaches the most courses?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.personal_name , T1.family_name , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1</SQL_QUERY> | e_learning | SELECT T1.personal_name , T1.family_name , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1 | What are the personal name, family name, and author ID of the course author who teaches the most courses? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the addresses and author IDs of the course authors that teach at least two courses.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.address_line_1 , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING Count(*) >= 2</SQL_QUERY> | e_learning | SELECT T1.address_line_1 , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING Count(*) >= 2 | Find the addresses and author IDs of the course authors that teach at least two courses. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which course authors teach two or more courses? Give me their addresses and author IDs.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.address_line_1 , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING Count(*) >= 2</SQL_QUERY> | e_learning | SELECT T1.address_line_1 , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING Count(*) >= 2 | Which course authors teach two or more courses? Give me their addresses and author IDs. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the names of courses taught by the tutor who has personal name "Julio".</question>
[SQL]:
| <SQL_QUERY>SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = "Julio"</SQL_QUERY> | e_learning | SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = "Julio" | Find the names of courses taught by the tutor who has personal name "Julio". | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the courses taught by the tutor whose personal name is "Julio"?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = "Julio"</SQL_QUERY> | e_learning | SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = "Julio" | What are the names of the courses taught by the tutor whose personal name is "Julio"? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the names and descriptions of courses that belong to the subject named "Computer Science".</question>
[SQL]:
| <SQL_QUERY>SELECT T1.course_name , T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = "Computer Science"</SQL_QUERY> | e_learning | SELECT T1.course_name , T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = "Computer Science" | Find the names and descriptions of courses that belong to the subject named "Computer Science". | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names and descriptions of the all courses under the "Computer Science" subject?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.course_name , T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = "Computer Science"</SQL_QUERY> | e_learning | SELECT T1.course_name , T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = "Computer Science" | What are the names and descriptions of the all courses under the "Computer Science" subject? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the subject ID, subject name, and the corresponding number of available courses for each subject.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id</SQL_QUERY> | e_learning | SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id | Find the subject ID, subject name, and the corresponding number of available courses for each subject. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the subject ID, subject name, and the number of available courses for each subject?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id</SQL_QUERY> | e_learning | SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id | What are the subject ID, subject name, and the number of available courses for each subject? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the subject ID, name of subject and the corresponding number of courses for each subject, and sort by the course count in ascending order.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC</SQL_QUERY> | e_learning | SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC | Find the subject ID, name of subject and the corresponding number of courses for each subject, and sort by the course count in ascending order. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the subject ID, name of subject and the number of courses available for each subject in ascending order of the course counts.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC</SQL_QUERY> | e_learning | SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC | List the subject ID, name of subject and the number of courses available for each subject in ascending order of the course counts. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the date of enrollment of the course named "Spanish"?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish"</SQL_QUERY> | e_learning | SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish" | What is the date of enrollment of the course named "Spanish"? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the the date of enrollment of the "Spanish" course.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish"</SQL_QUERY> | e_learning | SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish" | Find the the date of enrollment of the "Spanish" course. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the course that has the most student enrollment?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1</SQL_QUERY> | e_learning | SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1 | What is the name of the course that has the most student enrollment? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which course is enrolled in by the most students? Give me the course name.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1</SQL_QUERY> | e_learning | SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1 | Which course is enrolled in by the most students? Give me the course name. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the courses that have exactly 1 student enrollment?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1</SQL_QUERY> | e_learning | SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1 | What are the names of the courses that have exactly 1 student enrollment? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the names of the courses that have just one student enrollment.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1</SQL_QUERY> | e_learning | SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1 | Find the names of the courses that have just one student enrollment. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the descriptions and names of the courses that have student enrollment bigger than 2?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.course_description , T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2</SQL_QUERY> | e_learning | SELECT T1.course_description , T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2 | What are the descriptions and names of the courses that have student enrollment bigger than 2? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Return the descriptions and names of the courses that have more than two students enrolled in.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.course_description , T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2</SQL_QUERY> | e_learning | SELECT T1.course_description , T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2 | Return the descriptions and names of the courses that have more than two students enrolled in. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of each course and the corresponding number of student enrollment?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.course_name , COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name</SQL_QUERY> | e_learning | SELECT T1.course_name , COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name | What is the name of each course and the corresponding number of student enrollment? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the name and the number of enrolled student for each course.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.course_name , COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name</SQL_QUERY> | e_learning | SELECT T1.course_name , COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name | List the name and the number of enrolled student for each course. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the enrollment dates of all the tests that have result "Pass"?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass"</SQL_QUERY> | e_learning | SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" | What are the enrollment dates of all the tests that have result "Pass"? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the enrollment date for all the tests that have "Pass" result.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass"</SQL_QUERY> | e_learning | SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" | Find the enrollment date for all the tests that have "Pass" result. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the completion dates of all the tests that have result "Fail"?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail"</SQL_QUERY> | e_learning | SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" | What are the completion dates of all the tests that have result "Fail"? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Return the completion date for all the tests that have "Fail" result.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail"</SQL_QUERY> | e_learning | SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" | Return the completion date for all the tests that have "Fail" result. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the dates of enrollment and completion of the student with personal name "Karson".</question>
[SQL]:
| <SQL_QUERY>SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = "Karson"</SQL_QUERY> | e_learning | SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = "Karson" | List the dates of enrollment and completion of the student with personal name "Karson". | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>On what dates did the student whose personal name is "Karson" enroll in and complete the courses?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = "Karson"</SQL_QUERY> | e_learning | SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = "Karson" | On what dates did the student whose personal name is "Karson" enroll in and complete the courses? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the dates of enrollment and completion of the student with family name "Zieme" and personal name "Bernie".</question>
[SQL]:
| <SQL_QUERY>SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = "Zieme" AND T2.personal_name = "Bernie"</SQL_QUERY> | e_learning | SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = "Zieme" AND T2.personal_name = "Bernie" | List the dates of enrollment and completion of the student with family name "Zieme" and personal name "Bernie". | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>On what dates did the student with family name "Zieme" and personal name "Bernie" enroll in and complete the courses?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = "Zieme" AND T2.personal_name = "Bernie"</SQL_QUERY> | e_learning | SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = "Zieme" AND T2.personal_name = "Bernie" | On what dates did the student with family name "Zieme" and personal name "Bernie" enroll in and complete the courses? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the student ID and login name of the student with the most course enrollments</question>
[SQL]:
| <SQL_QUERY>SELECT T1.student_id , T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1</SQL_QUERY> | e_learning | SELECT T1.student_id , T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 | Find the student ID and login name of the student with the most course enrollments | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the student ID and login name of the student who are enrolled in the most courses?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.student_id , T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1</SQL_QUERY> | e_learning | SELECT T1.student_id , T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 | What are the student ID and login name of the student who are enrolled in the most courses? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the student ID and personal name of the student with at least two enrollments.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.student_id , T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2</SQL_QUERY> | e_learning | SELECT T1.student_id , T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2 | Find the student ID and personal name of the student with at least two enrollments. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which student are enrolled in at least two courses? Give me the student ID and personal name.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.student_id , T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2</SQL_QUERY> | e_learning | SELECT T1.student_id , T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2 | Which student are enrolled in at least two courses? Give me the student ID and personal name. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the student ID and middle name for all the students with at most two enrollments.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.student_id , T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2</SQL_QUERY> | e_learning | SELECT T1.student_id , T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2 | Find the student ID and middle name for all the students with at most two enrollments. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the student IDs and middle names of the students enrolled in at most two courses?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.student_id , T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2</SQL_QUERY> | e_learning | SELECT T1.student_id , T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2 | What are the student IDs and middle names of the students enrolled in at most two courses? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the personal names of students not enrolled in any course.</question>
[SQL]:
| <SQL_QUERY>SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id</SQL_QUERY> | e_learning | SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id | Find the personal names of students not enrolled in any course. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which students not enrolled in any course? Find their personal names.</question>
[SQL]:
| <SQL_QUERY>SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id</SQL_QUERY> | e_learning | SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id | Which students not enrolled in any course? Find their personal names. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students did not have any course enrollment?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Students WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Enrolment)</SQL_QUERY> | e_learning | SELECT count(*) FROM Students WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Enrolment) | How many students did not have any course enrollment? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Count the number of students who did not enroll in any course.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Students WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Enrolment)</SQL_QUERY> | e_learning | SELECT count(*) FROM Students WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Enrolment) | Count the number of students who did not enroll in any course. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the common login name of course authors and students.</question>
[SQL]:
| <SQL_QUERY>SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students</SQL_QUERY> | e_learning | SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students | Find the common login name of course authors and students. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the login names used both by some course authors and some students?</question>
[SQL]:
| <SQL_QUERY>SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students</SQL_QUERY> | e_learning | SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students | What are the login names used both by some course authors and some students? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the common personal name of course authors and students.</question>
[SQL]:
| <SQL_QUERY>SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students</SQL_QUERY> | e_learning | SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students | Find the common personal name of course authors and students. | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text);</schema>"
<primary_keys>[Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id</primary_keys>"
<foreign_keys>[Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the personal names used both by some course authors and some students?</question>
[SQL]:
| <SQL_QUERY>SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students</SQL_QUERY> | e_learning | SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students | What are the personal names used both by some course authors and some students? | [Schema (values) (types)]: | e_learning | Course_Authors_and_Tutors : author_id (text) , author_tutor_atb (number) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) , gender_mf (text) , address_line_1 (text) | Students : student_id (text) , date_of_registration (number) , date_of_latest_logon (text) , login_name (text) , password (text) , personal_name (text) , middle_name (text) , family_name (text) | Subjects : subject_id (text) , subject_name (number) | Courses : course_id (text) , author_id (number) , subject_id (text) , course_name (text) , course_description (text) | Student_Course_Enrolment : registration_id (text) , student_id (number) , course_id (text) , date_of_enrolment (text) , date_of_completion (text) | Student_Tests_Taken : registration_id (text) , date_test_taken (number) , test_result (text); | [Primary Keys]: course_authors_and_tutors : author_id, students : student_id, subjects : subject_id, courses : course_id, student_course_enrolment : registration_id | [Foreign Keys]: courses : subject_id = subjects : subject_id | courses : author_id = course_authors_and_tutors : author_id | student_course_enrolment : student_id = students : student_id | student_course_enrolment : course_id = courses : course_id | student_tests_taken : registration_id = student_course_enrolment : registration_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which claims caused more than 2 settlements or have the maximum claim value? List the date the claim was made and the claim id.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING count(*) > 2 UNION SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = ( SELECT max(Amount_Claimed) FROM Claims )</SQL_QUERY> | insurance_policies | SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING count(*) > 2 UNION SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = ( SELECT max(Amount_Claimed) FROM Claims ) | Which claims caused more than 2 settlements or have the maximum claim value? List the date the claim was made and the claim id. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the claims that led to more than two settlements or have the maximum claim value. For each of them, return the date the claim was made and the id of the claim.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING count(*) > 2 UNION SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = ( SELECT max(Amount_Claimed) FROM Claims )</SQL_QUERY> | insurance_policies | SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING count(*) > 2 UNION SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = ( SELECT max(Amount_Claimed) FROM Claims ) | Find the claims that led to more than two settlements or have the maximum claim value. For each of them, return the date the claim was made and the id of the claim. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which customer had at least 2 policies but did not file any claims? List the customer details and id.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2 EXCEPT SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims AS T3 ON T2.policy_id = T3.policy_id</SQL_QUERY> | insurance_policies | SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2 EXCEPT SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims AS T3 ON T2.policy_id = T3.policy_id | Which customer had at least 2 policies but did not file any claims? List the customer details and id. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Give me the the customer details and id for the customers who had two or more policies but did not file any claims.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2 EXCEPT SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims AS T3 ON T2.policy_id = T3.policy_id</SQL_QUERY> | insurance_policies | SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2 EXCEPT SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims AS T3 ON T2.policy_id = T3.policy_id | Give me the the customer details and id for the customers who had two or more policies but did not file any claims. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the method, date and amount of all the payments, in ascending order of date.</question>
[SQL]:
| <SQL_QUERY>SELECT Payment_Method_Code , Date_Payment_Made , Amount_Payment FROM Payments ORDER BY Date_Payment_Made ASC</SQL_QUERY> | insurance_policies | SELECT Payment_Method_Code , Date_Payment_Made , Amount_Payment FROM Payments ORDER BY Date_Payment_Made ASC | List the method, date and amount of all the payments, in ascending order of date. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the method, date and amount of each payment? Sort the list in ascending order of date.</question>
[SQL]:
| <SQL_QUERY>SELECT Payment_Method_Code , Date_Payment_Made , Amount_Payment FROM Payments ORDER BY Date_Payment_Made ASC</SQL_QUERY> | insurance_policies | SELECT Payment_Method_Code , Date_Payment_Made , Amount_Payment FROM Payments ORDER BY Date_Payment_Made ASC | What are the method, date and amount of each payment? Sort the list in ascending order of date. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount.</question>
[SQL]:
| <SQL_QUERY>SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1 | Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the settlement amount of the claim with the largest claim amount. Show both the settlement amount and claim amount.</question>
[SQL]:
| <SQL_QUERY>SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1 | Find the settlement amount of the claim with the largest claim amount. Show both the settlement amount and claim amount. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim amount.</question>
[SQL]:
| <SQL_QUERY>SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1 | Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim amount. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the claimed amount in the claim with the least amount settled. Show both the settlement amount and claim amount.</question>
[SQL]:
| <SQL_QUERY>SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1 | Find the claimed amount in the claim with the least amount settled. Show both the settlement amount and claim amount. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled.</question>
[SQL]:
| <SQL_QUERY>SELECT Date_Claim_Made , Date_Claim_Settled FROM Claims WHERE Amount_Claimed > ( SELECT avg(Amount_Claimed) FROM Claims )</SQL_QUERY> | insurance_policies | SELECT Date_Claim_Made , Date_Claim_Settled FROM Claims WHERE Amount_Claimed > ( SELECT avg(Amount_Claimed) FROM Claims ) | Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Give me the claim date, settlement date for all the claims whose claimed amount is larger than the average.</question>
[SQL]:
| <SQL_QUERY>SELECT Date_Claim_Made , Date_Claim_Settled FROM Claims WHERE Amount_Claimed > ( SELECT avg(Amount_Claimed) FROM Claims )</SQL_QUERY> | insurance_policies | SELECT Date_Claim_Made , Date_Claim_Settled FROM Claims WHERE Amount_Claimed > ( SELECT avg(Amount_Claimed) FROM Claims ) | Give me the claim date, settlement date for all the claims whose claimed amount is larger than the average. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date.</question>
[SQL]:
| <SQL_QUERY>SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= ( SELECT avg(Amount_Settled) FROM Claims )</SQL_QUERY> | insurance_policies | SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= ( SELECT avg(Amount_Settled) FROM Claims ) | Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Return the claim start date for the claims whose claimed amount is no more than the average</question>
[SQL]:
| <SQL_QUERY>SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= ( SELECT avg(Amount_Settled) FROM Claims )</SQL_QUERY> | insurance_policies | SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= ( SELECT avg(Amount_Settled) FROM Claims ) | Return the claim start date for the claims whose claimed amount is no more than the average | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many settlements does each claim correspond to? List the claim id and the number of settlements.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.Claim_id , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id</SQL_QUERY> | insurance_policies | SELECT T1.Claim_id , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id | How many settlements does each claim correspond to? List the claim id and the number of settlements. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of settlements each claim corresponds to. Show the number together with the claim id.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.Claim_id , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id</SQL_QUERY> | insurance_policies | SELECT T1.Claim_id , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id | Find the number of settlements each claim corresponds to. Show the number together with the claim id. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which claim incurred the most number of settlements? List the claim id, the date the claim was made, and the number.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.claim_id , T1.date_claim_made , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT T1.claim_id , T1.date_claim_made , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY count(*) DESC LIMIT 1 | Which claim incurred the most number of settlements? List the claim id, the date the claim was made, and the number. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the claim id and claim date of the claim that incurred the most settlement count. Also tell me the count.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.claim_id , T1.date_claim_made , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT T1.claim_id , T1.date_claim_made , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY count(*) DESC LIMIT 1 | Find the claim id and claim date of the claim that incurred the most settlement count. Also tell me the count. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT count(*) , T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1 | How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the claim id and the number of settlements made for the claim with the most recent settlement date.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT count(*) , T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1 | Find the claim id and the number of settlements made for the claim with the most recent settlement date. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Of all the claims, what was the earliest date when any claim was made?</question>
[SQL]:
| <SQL_QUERY>SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made ASC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made ASC LIMIT 1 | Of all the claims, what was the earliest date when any claim was made? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Tell me the the date when the first claim was made.</question>
[SQL]:
| <SQL_QUERY>SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made ASC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made ASC LIMIT 1 | Tell me the the date when the first claim was made. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the total amount of settlement made for all the settlements?</question>
[SQL]:
| <SQL_QUERY>SELECT sum(Amount_Settled) FROM Settlements</SQL_QUERY> | insurance_policies | SELECT sum(Amount_Settled) FROM Settlements | What is the total amount of settlement made for all the settlements? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Compute the total amount of settlement across all the settlements.</question>
[SQL]:
| <SQL_QUERY>SELECT sum(Amount_Settled) FROM Settlements</SQL_QUERY> | insurance_policies | SELECT sum(Amount_Settled) FROM Settlements | Compute the total amount of settlement across all the settlements. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who are the customers that had more than 1 policy? List the customer details and id.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING count(*) > 1</SQL_QUERY> | insurance_policies | SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING count(*) > 1 | Who are the customers that had more than 1 policy? List the customer details and id. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the the customer details and id for the customers who had more than one policy.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING count(*) > 1</SQL_QUERY> | insurance_policies | SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING count(*) > 1 | Find the the customer details and id for the customers who had more than one policy. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the claim dates and settlement dates of all the settlements?</question>
[SQL]:
| <SQL_QUERY>SELECT Date_Claim_Made , Date_Claim_Settled FROM Settlements</SQL_QUERY> | insurance_policies | SELECT Date_Claim_Made , Date_Claim_Settled FROM Settlements | What are the claim dates and settlement dates of all the settlements? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Tell me the the claim date and settlement date for each settlement case.</question>
[SQL]:
| <SQL_QUERY>SELECT Date_Claim_Made , Date_Claim_Settled FROM Settlements</SQL_QUERY> | insurance_policies | SELECT Date_Claim_Made , Date_Claim_Settled FROM Settlements | Tell me the the claim date and settlement date for each settlement case. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the most popular payment method?</question>
[SQL]:
| <SQL_QUERY>SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) DESC LIMIT 1 | What is the most popular payment method? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which payment method is used the most often?</question>
[SQL]:
| <SQL_QUERY>SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) DESC LIMIT 1 | Which payment method is used the most often? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>With which kind of payment method were the least number of payments processed?</question>
[SQL]:
| <SQL_QUERY>SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1 | With which kind of payment method were the least number of payments processed? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the payment method that were used the least often?</question>
[SQL]:
| <SQL_QUERY>SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1 | What is the payment method that were used the least often? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the total amount of payment?</question>
[SQL]:
| <SQL_QUERY>SELECT sum(Amount_Payment) FROM Payments</SQL_QUERY> | insurance_policies | SELECT sum(Amount_Payment) FROM Payments | What is the total amount of payment? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Compute the total amount of payment processed.</question>
[SQL]:
| <SQL_QUERY>SELECT sum(Amount_Payment) FROM Payments</SQL_QUERY> | insurance_policies | SELECT sum(Amount_Payment) FROM Payments | Compute the total amount of payment processed. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are all the distinct details of the customers?</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT customer_details FROM Customers</SQL_QUERY> | insurance_policies | SELECT DISTINCT customer_details FROM Customers | What are all the distinct details of the customers? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Return the distinct customer details.</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT customer_details FROM Customers</SQL_QUERY> | insurance_policies | SELECT DISTINCT customer_details FROM Customers | Return the distinct customer details. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which kind of policy type was chosen by the most customers?</question>
[SQL]:
| <SQL_QUERY>SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count(*) DESC LIMIT 1 | Which kind of policy type was chosen by the most customers? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the policy type the most customers choose.</question>
[SQL]:
| <SQL_QUERY>SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | insurance_policies | SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count(*) DESC LIMIT 1 | Find the policy type the most customers choose. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many settlements are there in total?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Settlements</SQL_QUERY> | insurance_policies | SELECT count(*) FROM Settlements | How many settlements are there in total? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Count the total number of settlements made.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Settlements</SQL_QUERY> | insurance_policies | SELECT count(*) FROM Settlements | Count the total number of settlements made. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which Payments were processed with Visa? List the payment Id, the date and the amount.</question>
[SQL]:
| <SQL_QUERY>SELECT Payment_ID , Date_Payment_Made , Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa'</SQL_QUERY> | insurance_policies | SELECT Payment_ID , Date_Payment_Made , Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' | Which Payments were processed with Visa? List the payment Id, the date and the amount. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Give me the payment Id, the date and the amount for all the payments processed with Visa.</question>
[SQL]:
| <SQL_QUERY>SELECT Payment_ID , Date_Payment_Made , Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa'</SQL_QUERY> | insurance_policies | SELECT Payment_ID , Date_Payment_Made , Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' | Give me the payment Id, the date and the amount for all the payments processed with Visa. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the details of the customers who do not have any policies.</question>
[SQL]:
| <SQL_QUERY>SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id</SQL_QUERY> | insurance_policies | SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id | List the details of the customers who do not have any policies. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which customers do not have any policies? Find the details of these customers.</question>
[SQL]:
| <SQL_QUERY>SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id</SQL_QUERY> | insurance_policies | SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id | Which customers do not have any policies? Find the details of these customers. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the date the claim was made, the date it was settled and the amount settled for all the claims which had exactly one settlement.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.claim_id , T1.date_claim_made , T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING count(*) = 1</SQL_QUERY> | insurance_policies | SELECT T1.claim_id , T1.date_claim_made , T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING count(*) = 1 | List the date the claim was made, the date it was settled and the amount settled for all the claims which had exactly one settlement. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which claims had exactly one settlement? For each, tell me the the date the claim was made, the date it was settled and the amount settled.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.claim_id , T1.date_claim_made , T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING count(*) = 1</SQL_QUERY> | insurance_policies | SELECT T1.claim_id , T1.date_claim_made , T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING count(*) = 1 | Which claims had exactly one settlement? For each, tell me the the date the claim was made, the date it was settled and the amount settled. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the total claimed amount of all the claims.</question>
[SQL]:
| <SQL_QUERY>SELECT sum(Amount_Claimed) FROM Claims</SQL_QUERY> | insurance_policies | SELECT sum(Amount_Claimed) FROM Claims | Find the total claimed amount of all the claims. | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is total amount claimed summed across all the claims?</question>
[SQL]:
| <SQL_QUERY>SELECT sum(Amount_Claimed) FROM Claims</SQL_QUERY> | insurance_policies | SELECT sum(Amount_Claimed) FROM Claims | What is total amount claimed summed across all the claims? | [Schema (values) (types)]: | insurance_policies | Customers : customer_id (text) , customer_details (number) | Customer_Policies : policy_id (text) , customer_id (number) , policy_type_code (text) , start_date (number) , end_date (number) | Claims : claim_id (text) , policy_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) | Settlements : settlement_id (text) , claim_id (number) , date_claim_made (text) , date_claim_settled (number) , amount_claimed (number) , amount_settled (text) , customer_policy_id (time) | Payments : payment_id (text) , settlement_id (number) , payment_method_code (text) , date_payment_made (number) , amount_payment (number); | [Primary Keys]: customers : customer_id, customer_policies : policy_id, claims : claim_id, settlements : settlement_id, payments : payment_id | [Foreign Keys]: customer_policies : customer_id = customers : customer_id | claims : policy_id = customer_policies : policy_id | settlements : claim_id = claims : claim_id | payments : settlement_id = settlements : settlement_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)]: | hospital_1 | Physician : employeeid (text) , name (number) , position (text) , ssn (text) | Department : departmentid (text) , name (number) , head (text) | Affiliated_With : physician (text) , department (number) , primaryaffiliation (text) | Procedures : code (text) , name (number) , cost (text) | Trained_In : physician (text) , treatment (number) , certificationdate (text) , certificationexpires (text) | Patient : ssn (text) , name (number) , address (text) , phone (text) , insuranceid (number) , pcp (number) | Nurse : employeeid (text) , name (number) , position (text) , registered (text) , ssn (number) | Appointment : appointmentid (text) , patient (number) , prepnurse (text) , physician (text) , start (number) , end (number) , examinationroom (text) | Medication : code (text) , name (number) , brand (text) , description (text) | Prescribes : physician (text) , patient (number) , medication (text) , date (text) , appointment (number) , dose (number) | Block : blockfloor (text) , blockcode (number) | Room : roomnumber (text) , roomtype (number) , blockfloor (text) , blockcode (text) , unavailable (number) | On_Call : nurse (text) , blockfloor (number) , blockcode (text) , oncallstart (text) , oncallend (number) | Stay : stayid (text) , patient (number) , room (text) , staystart (text) , stayend (number) | Undergoes : patient (text) , procedures (number) , stay (text) , dateundergoes (text) , physician (number) , assistingnurse (number);</schema>"
<primary_keys>[Primary Keys]: physician : employeeid, department : departmentid, affiliated_with : physician, procedures : code, trained_in : physician, patient : ssn, nurse : employeeid, appointment : appointmentid, medication : code, prescribes : physician, block : blockfloor, room : roomnumber, on_call : nurse, stay : stayid, undergoes : patient</primary_keys>"
<foreign_keys>[Foreign Keys]: department : head = physician : employeeid | affiliated_with : department = department : departmentid | affiliated_with : physician = physician : employeeid | trained_in : treatment = procedures : code | trained_in : physician = physician : employeeid | patient : pcp = physician : employeeid | appointment : physician = physician : employeeid | appointment : prepnurse = nurse : employeeid | appointment : patient = patient : ssn | prescribes : appointment = appointment : appointmentid | prescribes : medication = medication : code | prescribes : patient = patient : ssn | prescribes : physician = physician : employeeid | room : blockfloor = block : blockfloor | room : blockcode = block : blockcode | on_call : blockfloor = block : blockfloor | on_call : blockcode = block : blockcode | on_call : nurse = nurse : employeeid | stay : room = room : roomnumber | stay : patient = patient : ssn | undergoes : assistingnurse = nurse : employeeid | undergoes : physician = physician : employeeid | undergoes : stay = stay : stayid | undergoes : procedures = procedures : code | undergoes : patient = patient : ssn</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which department has the largest number of employees?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;</SQL_QUERY> | hospital_1 | SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1; | Which department has the largest number of employees? | [Schema (values) (types)]: | hospital_1 | Physician : employeeid (text) , name (number) , position (text) , ssn (text) | Department : departmentid (text) , name (number) , head (text) | Affiliated_With : physician (text) , department (number) , primaryaffiliation (text) | Procedures : code (text) , name (number) , cost (text) | Trained_In : physician (text) , treatment (number) , certificationdate (text) , certificationexpires (text) | Patient : ssn (text) , name (number) , address (text) , phone (text) , insuranceid (number) , pcp (number) | Nurse : employeeid (text) , name (number) , position (text) , registered (text) , ssn (number) | Appointment : appointmentid (text) , patient (number) , prepnurse (text) , physician (text) , start (number) , end (number) , examinationroom (text) | Medication : code (text) , name (number) , brand (text) , description (text) | Prescribes : physician (text) , patient (number) , medication (text) , date (text) , appointment (number) , dose (number) | Block : blockfloor (text) , blockcode (number) | Room : roomnumber (text) , roomtype (number) , blockfloor (text) , blockcode (text) , unavailable (number) | On_Call : nurse (text) , blockfloor (number) , blockcode (text) , oncallstart (text) , oncallend (number) | Stay : stayid (text) , patient (number) , room (text) , staystart (text) , stayend (number) | Undergoes : patient (text) , procedures (number) , stay (text) , dateundergoes (text) , physician (number) , assistingnurse (number); | [Primary Keys]: physician : employeeid, department : departmentid, affiliated_with : physician, procedures : code, trained_in : physician, patient : ssn, nurse : employeeid, appointment : appointmentid, medication : code, prescribes : physician, block : blockfloor, room : roomnumber, on_call : nurse, stay : stayid, undergoes : patient | [Foreign Keys]: department : head = physician : employeeid | affiliated_with : department = department : departmentid | affiliated_with : physician = physician : employeeid | trained_in : treatment = procedures : code | trained_in : physician = physician : employeeid | patient : pcp = physician : employeeid | appointment : physician = physician : employeeid | appointment : prepnurse = nurse : employeeid | appointment : patient = patient : ssn | prescribes : appointment = appointment : appointmentid | prescribes : medication = medication : code | prescribes : patient = patient : ssn | prescribes : physician = physician : employeeid | room : blockfloor = block : blockfloor | room : blockcode = block : blockcode | on_call : blockfloor = block : blockfloor | on_call : blockcode = block : blockcode | on_call : nurse = nurse : employeeid | stay : room = room : roomnumber | stay : patient = patient : ssn | undergoes : assistingnurse = nurse : employeeid | undergoes : physician = physician : employeeid | undergoes : stay = stay : stayid | undergoes : procedures = procedures : code | undergoes : patient = patient : ssn |
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)]: | hospital_1 | Physician : employeeid (text) , name (number) , position (text) , ssn (text) | Department : departmentid (text) , name (number) , head (text) | Affiliated_With : physician (text) , department (number) , primaryaffiliation (text) | Procedures : code (text) , name (number) , cost (text) | Trained_In : physician (text) , treatment (number) , certificationdate (text) , certificationexpires (text) | Patient : ssn (text) , name (number) , address (text) , phone (text) , insuranceid (number) , pcp (number) | Nurse : employeeid (text) , name (number) , position (text) , registered (text) , ssn (number) | Appointment : appointmentid (text) , patient (number) , prepnurse (text) , physician (text) , start (number) , end (number) , examinationroom (text) | Medication : code (text) , name (number) , brand (text) , description (text) | Prescribes : physician (text) , patient (number) , medication (text) , date (text) , appointment (number) , dose (number) | Block : blockfloor (text) , blockcode (number) | Room : roomnumber (text) , roomtype (number) , blockfloor (text) , blockcode (text) , unavailable (number) | On_Call : nurse (text) , blockfloor (number) , blockcode (text) , oncallstart (text) , oncallend (number) | Stay : stayid (text) , patient (number) , room (text) , staystart (text) , stayend (number) | Undergoes : patient (text) , procedures (number) , stay (text) , dateundergoes (text) , physician (number) , assistingnurse (number);</schema>"
<primary_keys>[Primary Keys]: physician : employeeid, department : departmentid, affiliated_with : physician, procedures : code, trained_in : physician, patient : ssn, nurse : employeeid, appointment : appointmentid, medication : code, prescribes : physician, block : blockfloor, room : roomnumber, on_call : nurse, stay : stayid, undergoes : patient</primary_keys>"
<foreign_keys>[Foreign Keys]: department : head = physician : employeeid | affiliated_with : department = department : departmentid | affiliated_with : physician = physician : employeeid | trained_in : treatment = procedures : code | trained_in : physician = physician : employeeid | patient : pcp = physician : employeeid | appointment : physician = physician : employeeid | appointment : prepnurse = nurse : employeeid | appointment : patient = patient : ssn | prescribes : appointment = appointment : appointmentid | prescribes : medication = medication : code | prescribes : patient = patient : ssn | prescribes : physician = physician : employeeid | room : blockfloor = block : blockfloor | room : blockcode = block : blockcode | on_call : blockfloor = block : blockfloor | on_call : blockcode = block : blockcode | on_call : nurse = nurse : employeeid | stay : room = room : roomnumber | stay : patient = patient : ssn | undergoes : assistingnurse = nurse : employeeid | undergoes : physician = physician : employeeid | undergoes : stay = stay : stayid | undergoes : procedures = procedures : code | undergoes : patient = patient : ssn</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the department with the most employees.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;</SQL_QUERY> | hospital_1 | SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1; | Find the department with the most employees. | [Schema (values) (types)]: | hospital_1 | Physician : employeeid (text) , name (number) , position (text) , ssn (text) | Department : departmentid (text) , name (number) , head (text) | Affiliated_With : physician (text) , department (number) , primaryaffiliation (text) | Procedures : code (text) , name (number) , cost (text) | Trained_In : physician (text) , treatment (number) , certificationdate (text) , certificationexpires (text) | Patient : ssn (text) , name (number) , address (text) , phone (text) , insuranceid (number) , pcp (number) | Nurse : employeeid (text) , name (number) , position (text) , registered (text) , ssn (number) | Appointment : appointmentid (text) , patient (number) , prepnurse (text) , physician (text) , start (number) , end (number) , examinationroom (text) | Medication : code (text) , name (number) , brand (text) , description (text) | Prescribes : physician (text) , patient (number) , medication (text) , date (text) , appointment (number) , dose (number) | Block : blockfloor (text) , blockcode (number) | Room : roomnumber (text) , roomtype (number) , blockfloor (text) , blockcode (text) , unavailable (number) | On_Call : nurse (text) , blockfloor (number) , blockcode (text) , oncallstart (text) , oncallend (number) | Stay : stayid (text) , patient (number) , room (text) , staystart (text) , stayend (number) | Undergoes : patient (text) , procedures (number) , stay (text) , dateundergoes (text) , physician (number) , assistingnurse (number); | [Primary Keys]: physician : employeeid, department : departmentid, affiliated_with : physician, procedures : code, trained_in : physician, patient : ssn, nurse : employeeid, appointment : appointmentid, medication : code, prescribes : physician, block : blockfloor, room : roomnumber, on_call : nurse, stay : stayid, undergoes : patient | [Foreign Keys]: department : head = physician : employeeid | affiliated_with : department = department : departmentid | affiliated_with : physician = physician : employeeid | trained_in : treatment = procedures : code | trained_in : physician = physician : employeeid | patient : pcp = physician : employeeid | appointment : physician = physician : employeeid | appointment : prepnurse = nurse : employeeid | appointment : patient = patient : ssn | prescribes : appointment = appointment : appointmentid | prescribes : medication = medication : code | prescribes : patient = patient : ssn | prescribes : physician = physician : employeeid | room : blockfloor = block : blockfloor | room : blockcode = block : blockcode | on_call : blockfloor = block : blockfloor | on_call : blockcode = block : blockcode | on_call : nurse = nurse : employeeid | stay : room = room : roomnumber | stay : patient = patient : ssn | undergoes : assistingnurse = nurse : employeeid | undergoes : physician = physician : employeeid | undergoes : stay = stay : stayid | undergoes : procedures = procedures : code | undergoes : patient = patient : ssn |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.