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: epinions_1
Question: Find the titles of items whose rating is higher than the average review rating of all items. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > (SELECT avg(rating) FROM review)
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: epinions_1
Question: Find the titles of items that received any rating below 5. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 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: epinions_1
Question: Find the titles of items that received both a rating higher than 8 and a rating below 5. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 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: epinions_1
Question: Find the names of items whose rank is higher than 3 and whose average rating is above 5. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rank > 3 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id HAVING avg(T2.... |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: epinions_1
Question: Find the name of the item with the lowest average rating. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY avg(T2.rating) 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: epinions_1
Question: List the titles of all items in alphabetic order . | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT title FROM item ORDER BY 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: epinions_1
Question: Find the name of the user who gives the most reviews. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id 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: epinions_1
Question: Find the name and id of the item with the highest average rating. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.title , T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY avg(T2.rating) 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: epinions_1
Question: Find the name and id of the good with the highest average rank. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.title , T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY avg(T2.rank) 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: epinions_1
Question: For each user, return the name and the average rating of reviews given by them. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.name , avg(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_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: epinions_1
Question: For each user, find their name and the number of reviews written by them. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.name , count(*) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_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: epinions_1
Question: Find the name of the user who gave the highest rating. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id ORDER BY T2.rating 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: epinions_1
Question: Find the name of the source user with the highest average trust score. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.source_u_id GROUP BY T2.source_u_id ORDER BY avg(trust) 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: epinions_1
Question: Find each target user's name and average trust score. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.name , avg(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_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: epinions_1
Question: Find the name of the target user with the lowest trust score. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id ORDER BY trust 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: epinions_1
Question: Find the names of the items that did not receive any review. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT title FROM item WHERE i_id NOT IN (SELECT i_id FROM review)
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: epinions_1
Question: Find the names of users who did not leave any review. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT name FROM useracct WHERE u_id NOT IN (SELECT u_id FROM review)
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: epinions_1
Question: Find the number of users who did not write any review. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT count(*) FROM useracct WHERE u_id NOT IN (SELECT u_id FROM review)
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: epinions_1
Question: Find the number of items without any review. | <think>
Analyze the request for database 'epinions_1' and construct the corresponding SQL query.
</think>
```sql
SELECT count(*) FROM item WHERE i_id NOT IN (SELECT i_id FROM review)
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: riding_club
Question: How many players are there? | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT count(*) FROM player
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: riding_club
Question: List the names of players in ascending order of votes. | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT Player_name FROM player ORDER BY Votes 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: riding_club
Question: What are the gender and occupation of players? | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT Gender , Occupation FROM player
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: riding_club
Question: List the name and residence for players whose occupation is not "Researcher". | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT Player_name , residence FROM player WHERE Occupation != "Researcher"
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: riding_club
Question: Show the names of sponsors of players whose residence is either "Brandon" or "Birtle". | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT Sponsor_name FROM player WHERE Residence = "Brandon" OR Residence = "Birtle"
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: riding_club
Question: What is the name of the player with the largest number of votes? | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT Player_name FROM player ORDER BY Votes 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: riding_club
Question: Show different occupations along with the number of players in each occupation. | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT Occupation , COUNT(*) FROM player GROUP BY Occupation
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: riding_club
Question: Please show the most common occupation of players. | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT Occupation FROM player GROUP BY Occupation 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: riding_club
Question: Show the residences that have at least two players. | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT Residence FROM player GROUP BY Residence 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: riding_club
Question: Show the names of players and names of their coaches. | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT T3.Player_name , T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_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: riding_club
Question: Show the names of players coached by the rank 1 coach. | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T2.Rank = 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: riding_club
Question: Show the names and genders of players with a coach starting after 2011. | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT T3.Player_name , T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: riding_club
Question: Show the names of players and names of their coaches in descending order of the votes of players. | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT T3.Player_name , T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID ORDER BY T3.Votes 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: riding_club
Question: List the names of players that do not have coaches. | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT Player_name FROM player WHERE Player_ID NOT IN (SELECT Player_ID FROM player_coach)
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: riding_club
Question: Show the residences that have both a player of gender "M" and a player of gender "F". | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT Residence FROM player WHERE gender = "M" INTERSECT SELECT Residence FROM player WHERE gender = "F"
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: riding_club
Question: How many coaches does each club has? List the club id, name and the number of coaches. | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.club_id , T1.club_name, count(*) FROM club AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_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: riding_club
Question: How many gold medals has the club with the most coaches won? | <think>
Analyze the request for database 'riding_club' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.club_id , T1.gold FROM match_result AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id 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: gymnast
Question: How many gymnasts are there? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT count(*) FROM gymnast
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: Count the number of gymnasts. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT count(*) FROM gymnast
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: List the total points of gymnasts in descending order. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Total_Points FROM gymnast ORDER BY Total_Points 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: gymnast
Question: What are the total points for all gymnasts, ordered by total points descending? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Total_Points FROM gymnast ORDER BY Total_Points 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: gymnast
Question: List the total points of gymnasts in descending order of floor exercise points. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points 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: gymnast
Question: What are the total points of gymnasts, ordered by their floor exercise points descending? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points 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: gymnast
Question: What is the average horizontal bar points for all gymnasts? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT avg(Horizontal_Bar_Points) FROM gymnast
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: Return the average horizontal bar points across all gymnasts. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT avg(Horizontal_Bar_Points) FROM gymnast
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: What are the names of people in ascending alphabetical order? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Name FROM People ORDER BY Name 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: gymnast
Question: Return the names of people, ordered alphabetically. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Name FROM People ORDER BY Name 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: gymnast
Question: What are the names of gymnasts? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_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: gymnast
Question: Return the names of the gymnasts. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_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: gymnast
Question: What are the names of gymnasts whose hometown is not "Santo Domingo"? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown != "Santo Domingo"
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: Return the names of gymnasts who did not grow up in Santo Domingo. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown != "Santo Domingo"
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: What is the age of the tallest person? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Age FROM people ORDER BY Height 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: gymnast
Question: Return the age of the person with the greatest height. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Age FROM people ORDER BY Height 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: gymnast
Question: List the names of the top 5 oldest people. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Name FROM People ORDER BY Age 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: gymnast
Question: What are the names of the five oldest people? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Name FROM People ORDER BY Age 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: gymnast
Question: What is the total point count of the youngest gymnast? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC 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: gymnast
Question: Return the total points of the gymnast with the lowest age. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC 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: gymnast
Question: What is the average age of all gymnasts? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT avg(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_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: gymnast
Question: Return the average age across all gymnasts. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT avg(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_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: gymnast
Question: What are the distinct hometowns of gymnasts with total points more than 57.5? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.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: gymnast
Question: Give the different hometowns of gymnasts that have a total point score of above 57.5. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.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: gymnast
Question: What are the hometowns of gymnasts and the corresponding number of gymnasts? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Hometown , COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: How many gymnasts are from each hometown? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Hometown , COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: What is the most common hometown of gymnasts? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown 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: gymnast
Question: Return the hometown that is most common among gymnasts. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown 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: gymnast
Question: What are the hometowns that are shared by at least two gymnasts? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown 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: gymnast
Question: Give the hometowns from which two or more gymnasts are from. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown 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: gymnast
Question: List the names of gymnasts in ascending order by their heights. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height 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: gymnast
Question: What are the names of gymnasts, ordered by their heights ascending? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height 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: gymnast
Question: List the distinct hometowns that are not associated with any gymnast. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_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: gymnast
Question: From which hometowns did no gymnasts come from? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_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: gymnast
Question: Show the hometowns shared by people older than 23 and younger than 20. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: From which hometowns did both people older than 23 and younger than 20 come from? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: How many distinct hometowns did these people have? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT count(DISTINCT Hometown) FROM people
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: Count the number of different hometowns of these people. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT count(DISTINCT Hometown) FROM people
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: gymnast
Question: Show the ages of gymnasts in descending order of total points. | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points 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: gymnast
Question: What are the ages of the gymnasts, ordered descending by their total points? | <think>
Analyze the request for database 'gymnast' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points 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: small_bank_1
Question: Find the total savings balance of all accounts except the account with name ‘Brown’. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT sum(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name != 'Brown'
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: What is the total balance of savings accounts not belonging to someone with the name Brown? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT sum(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name != 'Brown'
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: How many accounts are there in total? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT count(*) FROM accounts
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: Count the number of accounts. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT count(*) FROM accounts
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: What is the total checking balance in all accounts? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT sum(balance) FROM checking
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: Find the total balance across checking accounts. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT sum(balance) FROM checking
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: Find the average checking balance. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT avg(balance) FROM checking
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: What is the average balance in checking accounts? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT avg(balance) FROM checking
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: How many accounts have a savings balance above the average savings balance? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT count(*) FROM savings WHERE balance > (SELECT avg(balance) FROM savings)
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: Find the number of accounts with a savings balance that is higher than the average savings balance. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT count(*) FROM savings WHERE balance > (SELECT avg(balance) FROM savings)
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: Find the name and id of accounts whose checking balance is below the maximum checking balance. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.custid , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT max(balance) FROM checking)
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: What are the customer id and name corresponding to accounts with a checking balance less than the largest checking balance? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.custid , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT max(balance) FROM checking)
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: What is the checking balance of the account whose owner’s name contains the substring ‘ee’? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%'
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: Find the balance of the checking account belonging to an owner whose name contains 'ee'. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%'
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: Find the checking balance and saving balance in the Brown’s account. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.balance , T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T1.name = 'Brown'
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: What are the checking and savings balances in accounts belonging to Brown? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.balance , T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T1.name = 'Brown'
``` |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: Find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON... |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: What are the names of accounts with checking balances greater than the average checking balance and savings balances below the average savings balance? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON... |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: Find the checking balance of the accounts whose savings balance is higher than the average savings balance. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > ... |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: What are the balances of checking accounts belonging to people with savings balances greater than the average savings balance? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > ... |
You are an expert SQL assistant. Given the database schema and question, write the correct SQL query wrapped in a reasoning block. | Database ID: small_bank_1
Question: List all customers’ names in the alphabetical order. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT name FROM accounts ORDER BY 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: small_bank_1
Question: What are the names of all the customers in alphabetical order? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT name FROM accounts ORDER BY 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: small_bank_1
Question: Find the name of account that has the lowest total checking and saving balance. | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance 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: small_bank_1
Question: What is the name corresponding to the accoung with the lowest sum of checking and savings balances? | <think>
Analyze the request for database 'small_bank_1' and construct the corresponding SQL query.
</think>
```sql
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance LIMIT 1
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.