instruction
large_stringclasses
1 value
input
large_stringlengths
49
249
output
large_stringlengths
135
574
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: soccer_1 Question: List the names of all left-footed players who have overall rating between 85 and 90.
<think> Analyze the request for database 'soccer_1' and construct the corresponding SQL query. </think> ```sql SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot = "left" AND T2.overall_rating >= 85 AND T2.overall_rating <= ...
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: soccer_1 Question: What is the average rating for right-footed players and left-footed players?
<think> Analyze the request for database 'soccer_1' and construct the corresponding SQL query. </think> ```sql SELECT preferred_foot , avg(overall_rating) FROM Player_Attributes GROUP BY preferred_foot ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: soccer_1 Question: Of all players with an overall rating greater than 80, how many are right-footed and left-footed?
<think> Analyze the request for database 'soccer_1' and construct the corresponding SQL query. </think> ```sql SELECT preferred_foot , count(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: soccer_1 Question: List all of the player ids with a height of at least 180cm and an overall rating higher than 85.
<think> Analyze the request for database 'soccer_1' and construct the corresponding SQL query. </think> ```sql SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: soccer_1 Question: List all of the ids for left-footed players with a height between 180cm and 190cm.
<think> Analyze the request for database 'soccer_1' and construct the corresponding SQL query. </think> ```sql SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = "left" ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: soccer_1 Question: Who are the top 3 players in terms of overall rating?
<think> Analyze the request for database 'soccer_1' and construct the corresponding SQL query. </think> ```sql SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY overall_rating DESC LIMIT 3 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: soccer_1 Question: List the names and birthdays of the top five players in terms of potential.
<think> Analyze the request for database 'soccer_1' and construct the corresponding SQL query. </think> ```sql SELECT DISTINCT T1.player_name , T1.birthday FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: How many performances are there?
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT count(*) FROM performance ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: List the hosts of performances in ascending order of attendance.
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT HOST FROM performance ORDER BY Attendance ASC ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: What are the dates and locations of performances?
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT Date , LOCATION FROM performance ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: Show the attendances of the performances at location "TD Garden" or "Bell Centre"
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT Attendance FROM performance WHERE LOCATION = "TD Garden" OR LOCATION = "Bell Centre" ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: What is the average number of attendees for performances?
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT avg(Attendance) FROM performance ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: What is the date of the performance with the highest number of attendees?
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: Show different locations and the number of performances at each location.
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT LOCATION , COUNT(*) FROM performance GROUP BY LOCATION ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: Show the most common location of performances.
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT LOCATION FROM performance GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: Show the locations that have at least two performances.
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*) >= 2 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees.
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT LOCATION FROM performance WHERE Attendance > 2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance < 1000 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: Show the names of members and the location of the performances they attended.
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT T2.Name , T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: Show the names of members and the location of performances they attended in ascending alphabetical order of their names.
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT T2.Name , T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T2.Name AS...
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: Show the dates of performances with attending members whose roles are "Violin".
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = "Violin" ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: Show the names of members and the dates of performances they attended in descending order of attendance of the performances.
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT T2.Name , T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T3.Attendance ...
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: performance_attendance Question: List the names of members who did not attend any performance.
<think> Analyze the request for database 'performance_attendance' and construct the corresponding SQL query. </think> ```sql SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM member_attendance) ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the buildings which have rooms with capacity more than 50.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT DISTINCT building FROM classroom WHERE capacity > 50 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the distinct buildings with capacities of greater than 50?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT DISTINCT building FROM classroom WHERE capacity > 50 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Count the number of rooms that are not in the Lamberton building.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(*) FROM classroom WHERE building != 'Lamberton' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: How many classrooms are not in Lamberton?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(*) FROM classroom WHERE building != 'Lamberton' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What is the name and building of the departments whose budget is more than the average budget?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department) ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Give the name and building of the departments with greater than average budget.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department) ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the room number of the rooms which can sit 50 to 100 students and their buildings.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the name and building of the department with the highest budget.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What is the department name and corresponding building for the department with the greatest budget?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What is the name of the student who has the highest total credits in the History department.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Give the name of the student in the History department with the most credits.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: How many rooms does the Lamberton building have?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(*) FROM classroom WHERE building = 'Lamberton' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Count the number of classrooms in Lamberton.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(*) FROM classroom WHERE building = 'Lamberton' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: How many students have advisors?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(DISTINCT s_id) FROM advisor ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Count the number of students who have advisors.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(DISTINCT s_id) FROM advisor ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: How many departments offer courses?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(DISTINCT dept_name) FROM course ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Count the number of departments which offer courses.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(DISTINCT dept_name) FROM course ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: How many different courses offered by Physics department?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Count the number of courses in the Physics department.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the title of courses that have two prerequisites?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) = 2 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the titles for courses with two prerequisites?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) = 2 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the title, credit, and department name of courses that have more than one prerequisites?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT T1.title , T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) > 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What is the title, credit value, and department name for courses with more than one prerequisite?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT T1.title , T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) > 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: How many courses that do not have prerequisite?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq) ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Count the number of courses without prerequisites.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq) ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the name of the courses that do not have any prerequisite?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq) ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the titles of courses without prerequisites?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq) ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: How many different instructors have taught some course?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT COUNT (DISTINCT id) FROM teaches ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Count the number of distinct instructors who have taught a course.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT COUNT (DISTINCT id) FROM teaches ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the total budgets of the Marketing or Finance department.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What is the sum of budgets of the Marketing and Finance departments?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the department name of the instructor whose name contains 'Soisalon'.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What is the name of the department with an instructure who has a name like 'Soisalon'?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: How many rooms whose capacity is less than 50 does the Lamberton building have?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Count the number of rooms in Lamberton with capacity lower than 50.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the name and budget of departments whose budgets are more than the average budget.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department) ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the names and budgets of departments with budgets greater than the average?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department) ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: what is the name of the instructor who is in Statistics department and earns the lowest salary?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Give the name of the lowest earning instructor in the Statistics department.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the title of course that is provided by both Statistics and Psychology departments.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What is the title of a course that is listed in both the Statistics and Psychology departments?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the title of course that is provided by Statistics but not Psychology departments.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the titles of courses that are in the Statistics department but not the Psychology department?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology' ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the id of instructors who taught a class in Fall 2009 but not in Spring 2010.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the ids of instructors who taught in the Fall of 2009 but not in the Spring of 2010?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the name of students who took any class in the years of 2009 and 2010.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the names of the students who took classes in 2009 or 2010?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the names of the top 3 departments that provide the largest amount of courses?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the names of the 3 departments with the most courses?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the name of the department that offers the highest total credits?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What is the name of the department with the most credits?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: List the names of all courses ordered by their titles and credits.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT title FROM course ORDER BY title , credits ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Given the titles of all courses, in order of titles and credits.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT title FROM course ORDER BY title , credits ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Which department has the lowest budget?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name FROM department ORDER BY budget LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Give the name of the department with the lowest budget.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name FROM department ORDER BY budget LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: List the names and buildings of all departments sorted by the budget from large to small.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name , building FROM department ORDER BY budget DESC ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the names and buildings of the deparments, sorted by budget descending?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT dept_name , building FROM department ORDER BY budget DESC ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Who is the instructor with the highest salary?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT name FROM instructor ORDER BY salary DESC LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Give the name of the highest paid instructor.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT name FROM instructor ORDER BY salary DESC LIMIT 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: List the information of all instructors ordered by their salary in ascending order.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT * FROM instructor ORDER BY salary ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Give all information regarding instructors, in order of salary from least to greatest.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT * FROM instructor ORDER BY salary ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the name of the students and their department names sorted by their total credits in ascending order.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT name , dept_name FROM student ORDER BY tot_cred ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the names of students and their respective departments, ordered by number of credits from least to greatest?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT name , dept_name FROM student ORDER BY tot_cred ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: list in alphabetic order all course names and their instructors' names in year 2008.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT T1.title , T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE YEAR = 2008 ORDER BY T1.title ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Show all titles and their instructors' names for courses in 2008, in alphabetical order by title.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT T1.title , T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE YEAR = 2008 ORDER BY T1.title ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the name of instructors who are advising more than one student.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING count(*) > 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the names of instructors who advise more than one student?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING count(*) > 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the name of the students who have more than one advisor?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING count(*) > 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the names of students who have more than one advisor?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING count(*) > 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the number of rooms with more than 50 capacity for each building.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: How many rooms in each building have a capacity of over 50?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the maximum and average capacity among rooms in each building.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the greatest and average capacity for rooms in each building?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the title of the course that is offered by more than one department.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT title FROM course GROUP BY title HAVING count(*) > 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: What are the titles of courses that are offered in more than one department?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT title FROM course GROUP BY title HAVING count(*) > 1 ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: Find the total credits of courses provided by different department.
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT sum(credits) , dept_name FROM course GROUP BY dept_name ```
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block.
Database ID: college_2 Question: How many total credits are offered by each department?
<think> Analyze the request for database 'college_2' and construct the corresponding SQL query. </think> ```sql SELECT sum(credits) , dept_name FROM course GROUP BY dept_name ```