instruction_seed stringlengths 305 1.28k | response_seed stringclasses 1
value | response stringlengths 7 2.05k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|---|
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE matches (tourney_name VARCHAR)
Question: Find the name of tourney that has more than 10 matches.
Here is the SQLite query to answer to the question: Find the name of tou... | Here is the SQLite query to find the name of the tournament that has more than 10 matches:
```sql
SELECT tourney_name FROM matches GROUP BY tourney_name HAVING COUNT(*) > 10
``` | 4,200 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE matches (tourney_name VARCHAR)\n\n Question: Find the name of tourney that has more than 10 matches.\n\nHere is the SQLite query t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE matches (winner_name VARCHAR, YEAR VARCHAR)
Question: List the names of all winners who played in both 2013 and 2016.
Here is the SQLite query to answer to the question:... | Here is the SQLite query to answer the question about the winners who played in both 2013 and 2016:
```
SELECT winner_name FROM matches WHERE YEAR = '2013'
INTERSECT
SELECT winner_name FROM matches WHERE YEAR = '2016';
``` | 4,201 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE matches (winner_name VARCHAR, YEAR VARCHAR)\n\n Question: List the names of all winners who played in both 2013 and 2016.\n\nHere ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE matches (YEAR VARCHAR)
Question: List the number of all matches who played in years of 2013 or 2016.
Here is the SQLite query to answer to the question: List the number ... | Your provided SQL query has the right idea but needs a minor adjustment. The `YEAR` column is defined as `VARCHAR`, so we should treat the year values as strings. Here’s the corrected query:
```sql
SELECT COUNT(*) FROM matches WHERE YEAR = '2013' OR YEAR = '2016';
``` | 4,202 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE matches (YEAR VARCHAR)\n\n Question: List the number of all matches who played in years of 2013 or 2016.\n\nHere is the SQLite que... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE matches (winner_id VARCHAR, tourney_name VARCHAR); CREATE TABLE players (country_code VARCHAR, first_name VARCHAR, player_id VARCHAR)
Question: What are the country code ... | Here is the SQLite query to find the country code and first name of the players who won in both the WTA Championships and the Australian Open:
```sql
SELECT T1.country_code, T1.first_name
FROM players AS T1
JOIN matches AS T2 ON T1.player_id = T2.winner_id
WHERE T2.tourney_name = 'WTA Championships'
INTERSECT
SEL... | 4,203 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE matches (winner_id VARCHAR, tourney_name VARCHAR); CREATE TABLE players (country_code VARCHAR, first_name VARCHAR, player_id VARCHAR)... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE players (first_name VARCHAR, country_code VARCHAR, birth_date VARCHAR)
Question: Find the first name and country code of the oldest player.
Here is the SQLite query to a... | Your SQLite query is almost correct for finding the oldest player, but you'll need to ensure that the birth_date is treated as a date in the ORDER BY clause. Here’s the revised query:
```sql
SELECT first_name, country_code
FROM players
ORDER BY birth_date
LIMIT 1;
```
This query sorts the players by their birth d... | 4,204 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE players (first_name VARCHAR, country_code VARCHAR, birth_date VARCHAR)\n\n Question: Find the first name and country code of the o... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE players (first_name VARCHAR, last_name VARCHAR, birth_date VARCHAR)
Question: List the first and last name of all players in the order of birth date.
Here is the SQLite ... | Here is the SQLite query to answer the question of listing the first and last name of all players in the order of birth date:
```
SELECT first_name, last_name FROM players ORDER BY birth_date;
``` | 4,205 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE players (first_name VARCHAR, last_name VARCHAR, birth_date VARCHAR)\n\n Question: List the first and last name of all players in t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE players (first_name VARCHAR, last_name VARCHAR, hand VARCHAR, birth_date VARCHAR)
Question: List the first and last name of all players who are left / L hand in the order... | Here is the SQLite query to answer the question:
```
SELECT first_name, last_name FROM players WHERE hand = 'L' ORDER BY birth_date;
``` | 4,206 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE players (first_name VARCHAR, last_name VARCHAR, hand VARCHAR, birth_date VARCHAR)\n\n Question: List the first and last name of al... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE players (country_code VARCHAR, first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR, tours VARCHAR)
Question: Find the first name and country ... | Your query is almost correct; however, it doesn't handle the aggregation needed to find the player with the most tours properly. You should use `GROUP BY` to count the tours for each player and then order them accordingly. Here’s the corrected version of the query:
```sql
SELECT T1.country_code, T1.first_name
FROM pla... | 4,207 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE players (country_code VARCHAR, first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR, tours VARCHAR)\n\n ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE matches (YEAR VARCHAR)
Question: Find the year that has the most number of matches.
Here is the SQLite query to answer to the question: Find the year that has the most n... | Your SQL query to find the year that has the most number of matches is correct. Here it is wrapped as requested:
```
SELECT YEAR FROM matches GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1
```
This query groups the matches by year, counts the number of matches for each year, orders them in descending order by count, a... | 4,208 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE matches (YEAR VARCHAR)\n\n Question: Find the year that has the most number of matches.\n\nHere is the SQLite query to answer to t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE matches (winner_name VARCHAR, winner_rank_points VARCHAR)
Question: Find the name and rank points of the winner who won the most times.
Here is the SQLite query to answe... | Your SQLite query is almost correct, but you should include an aggregate function like `COUNT(*)` in the `SELECT` clause to ensure that you get the count of the wins for each winner. Also, you'll want to ensure you get the corresponding `winner_rank_points` for the winner who won the most times.
Here’s how you can str... | 4,209 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE matches (winner_name VARCHAR, winner_rank_points VARCHAR)\n\n Question: Find the name and rank points of the winner who won the mo... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE matches (winner_name VARCHAR, tourney_name VARCHAR, winner_rank_points VARCHAR)
Question: Find the name of the winner who has the highest rank points and participated in ... | Your SQLite query to find the name of the winner with the highest rank points who participated in the Australian Open tournament looks correct. Here it is wrapped in the requested code format:
```
SELECT winner_name FROM matches WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1
``` | 4,210 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE matches (winner_name VARCHAR, tourney_name VARCHAR, winner_rank_points VARCHAR)\n\n Question: Find the name of the winner who has ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE matches (winner_name VARCHAR, loser_name VARCHAR, minutes VARCHAR)
Question: find the names of loser and winner who played in the match with greatest number of minutes.
... | Your query is close, but since the `minutes` column is defined as a `VARCHAR`, you need to ensure that you are ordering the matches by converting the `minutes` to an integer, assuming the values represent numeric times.
Here’s the corrected query:
```sql
SELECT winner_name, loser_name
FROM matches
ORDER BY CAST(min... | 4,211 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE matches (winner_name VARCHAR, loser_name VARCHAR, minutes VARCHAR)\n\n Question: find the names of loser and winner who played in ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE players (first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR)
Question: Find the average ranking for each player and their first name.
Here ... | The provided query has a minor issue. The `rankings` table does not have a `ranking` column in the schema you've shown. Assuming that the `rankings` table contains a mapping of player IDs but does not store actual rank values, there would be no way to calculate an average ranking.
However, if we assume that the `ranki... | 4,212 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE players (first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR)\n\n Question: Find the average ranking ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE players (first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR)
Question: Find the total ranking points for each player and their first name.
... | Your query is close, but it's missing the `ranking_points` column in the `rankings` table, which is essential for calculating the total ranking points for each player. Assuming that the `rankings` table includes a column for `ranking_points`, the corrected query should look like this:
```sql
SELECT SUM(T2.ranking_poin... | 4,213 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE players (first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR)\n\n Question: Find the total ranking po... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE players (country_code VARCHAR)
Question: find the number of players for each country.
Here is the SQLite query to answer to the question: find the number of players for ... | Here is the SQLite query to find the number of players for each country:
```sql
SELECT COUNT(*) AS player_count, country_code
FROM players
GROUP BY country_code;
``` | 4,214 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE players (country_code VARCHAR)\n\n Question: find the number of players for each country.\n\nHere is the SQLite query to answer to... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE players (country_code VARCHAR)
Question: find the code of the country where has the greatest number of players.
Here is the SQLite query to answer to the question: find ... | Your SQLite query to find the code of the country with the greatest number of players is correct. Here it is wrapped in code formatting:
```
SELECT country_code FROM players GROUP BY country_code ORDER BY COUNT(*) DESC LIMIT 1
```
This query will group the players by their country code, count the number of players p... | 4,215 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE players (country_code VARCHAR)\n\n Question: find the code of the country where has the greatest number of players.\n\nHere is the... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE players (country_code VARCHAR)
Question: Find the codes of countries that have more than 50 players.
Here is the SQLite query to answer to the question: Find the codes o... | Your SQLite query is correct for finding the codes of countries that have more than 50 players. Here it is wrapped in the specified format:
```
SELECT country_code FROM players GROUP BY country_code HAVING COUNT(*) > 50
``` | 4,216 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE players (country_code VARCHAR)\n\n Question: Find the codes of countries that have more than 50 players.\n\nHere is the SQLite que... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE rankings (ranking_date VARCHAR, tours INTEGER)
Question: Find the total number of tours for each ranking date.
Here is the SQLite query to answer to the question: Find t... | Your SQLite query is almost correct, but it's better practice to provide an alias for the sum for clarity. Here's the revised query:
```sql
SELECT ranking_date, SUM(tours) AS total_tours
FROM rankings
GROUP BY ranking_date
```
This query will return the total number of tours for each ranking date with a clear colu... | 4,217 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE rankings (ranking_date VARCHAR, tours INTEGER)\n\n Question: Find the total number of tours for each ranking date.\n\nHere is the ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE matches (YEAR VARCHAR)
Question: Find the number of matches happened in each year.
Here is the SQLite query to answer to the question: Find the number of matches happene... | Your provided query is correct for counting the number of matches that occurred each year based on the given schema. Here it is wrapped in code format:
```
SELECT COUNT(*), YEAR FROM matches GROUP BY YEAR;
```
This query selects the count of matches and groups the results by the YEAR, thereby giving the total matche... | 4,218 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE matches (YEAR VARCHAR)\n\n Question: Find the number of matches happened in each year.\n\nHere is the SQLite query to answer to th... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE matches (winner_name VARCHAR, winner_rank VARCHAR, winner_age VARCHAR)
Question: Find the name and rank of the 3 youngest winners across all matches.
Here is the SQLite ... | Your SQL query is mostly correct, but it could be improved by ensuring that `winner_age` is treated as a numerical value rather than a string. Additionally, it is a good practice to ensure that the ordering captures the youngest ages correctly.
Assuming `winner_age` is stored as a string but represents integers, you w... | 4,219 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE matches (winner_name VARCHAR, winner_rank VARCHAR, winner_age VARCHAR)\n\n Question: Find the name and rank of the 3 youngest winn... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE matches (winner_name VARCHAR, tourney_name VARCHAR, winner_hand VARCHAR)
Question: How many different winners both participated in the WTA Championships and were left han... | Your SQLite query is correctly formulated to count the number of different winners who participated in the 'WTA Championships' and are left-handed. Here it is wrapped in code formatting:
```
SELECT COUNT(DISTINCT winner_name) FROM matches WHERE tourney_name = 'WTA Championships' AND winner_hand = 'L';
``` | 4,220 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE matches (winner_name VARCHAR, tourney_name VARCHAR, winner_hand VARCHAR)\n\n Question: How many different winners both participate... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE players (first_name VARCHAR, country_code VARCHAR, birth_date VARCHAR, player_id VARCHAR); CREATE TABLE matches (winner_id VARCHAR, winner_rank_points VARCHAR)
Question: ... | Your SQLite query is almost correct, but there is a small correction needed regarding the type of the `winner_rank_points` to ensure it is sorted correctly. Assuming `winner_rank_points` is an integer or can be treated as one for ordering, your query should work. However, if it's stored as text, we might want to cast i... | 4,221 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE players (first_name VARCHAR, country_code VARCHAR, birth_date VARCHAR, player_id VARCHAR); CREATE TABLE matches (winner_id VARCHAR, w... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE players (hand VARCHAR)
Question: Find the number of players for each hand type.
Here is the SQLite query to answer to the question: Find the number of players for each h... | Your SQLite query to find the number of players for each hand type is correct. Here it is wrapped correctly in code formatting:
```
SELECT COUNT(*), hand FROM players GROUP BY hand;
``` | 4,222 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE players (hand VARCHAR)\n\n Question: Find the number of players for each hand type.\n\nHere is the SQLite query to answer to the q... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ship (disposition_of_ship VARCHAR)
Question: How many ships ended up being 'Captured'?
Here is the SQLite query to answer to the question: How many ships ended up being ... | Here is the SQLite query to answer the question about how many ships ended up being 'Captured':
```
SELECT COUNT(*) FROM ship WHERE disposition_of_ship = 'Captured'
``` | 4,223 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ship (disposition_of_ship VARCHAR)\n\n Question: How many ships ended up being 'Captured'?\n\nHere is the SQLite query to answer t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ship (name VARCHAR, tonnage VARCHAR)
Question: List the name and tonnage ordered by in descending alphaetical order for the names.
Here is the SQLite query to answer to ... | Your provided query correctly answers the question. Here is the SQLite query wrapped in code block format:
```
SELECT name, tonnage FROM ship ORDER BY name DESC;
``` | 4,224 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ship (name VARCHAR, tonnage VARCHAR)\n\n Question: List the name and tonnage ordered by in descending alphaetical order for the na... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE battle (name VARCHAR, date VARCHAR)
Question: List the name, date and result of each battle.
Here is the SQLite query to answer to the question: List the name, date and ... | To include the result of each battle, you would need to modify the schema to have a 'result' column in the `battle` table. Assuming the updated schema includes a `result` column, here is the SQLite query to list the name, date, and result of each battle:
```sql
SELECT name, date, result FROM battle
```
If the `battle... | 4,225 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE battle (name VARCHAR, date VARCHAR)\n\n Question: List the name, date and result of each battle.\n\nHere is the SQLite query to an... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE death (killed INTEGER)
Question: What is maximum and minimum death toll caused each time?
Here is the SQLite query to answer to the question: What is maximum and minimum... | Your SQL query to find the maximum and minimum death toll in the `death` table is correct. Here it is formatted as requested:
```
SELECT MAX(killed), MIN(killed) FROM death;
```
This query will return the highest and lowest values from the `killed` column in the `death` table. | 4,226 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE death (killed INTEGER)\n\n Question: What is maximum and minimum death toll caused each time?\n\nHere is the SQLite query to answe... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE death (injured INTEGER)
Question: What is the average number of injuries caused each time?
Here is the SQLite query to answer to the question: What is the average number... | Here is the SQLite query to answer the question about the average number of injuries caused each time:
```
SELECT AVG(injured) FROM death;
``` | 4,227 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE death (injured INTEGER)\n\n Question: What is the average number of injuries caused each time?\n\nHere is the SQLite query to answ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ship (Id VARCHAR); CREATE TABLE death (killed VARCHAR, injured VARCHAR, caused_by_ship_id VARCHAR)
Question: What are the death and injury situations caused by the ship w... | It looks like there is a small issue with the table schema provided and the query you wrote. The `ship` table does not have a `tonnage` column in the schema you provided. Assuming you meant to include a `tonnage` column in the `ship` table, the corrected schema would be:
```sql
CREATE TABLE ship (Id VARCHAR, tonnage V... | 4,228 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ship (Id VARCHAR); CREATE TABLE death (killed VARCHAR, injured VARCHAR, caused_by_ship_id VARCHAR)\n\n Question: What are the deat... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE battle (name VARCHAR, RESULT VARCHAR, bulgarian_commander VARCHAR)
Question: What are the name and results of the battles when the bulgarian commander is not 'Boril'
Her... | Your SQLite query is correct. Here it is wrapped in code formatting:
```
SELECT name, RESULT FROM battle WHERE bulgarian_commander <> 'Boril'
```
This query selects the `name` and `RESULT` fields from the `battle` table where the `bulgarian_commander` is not 'Boril'. | 4,229 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE battle (name VARCHAR, RESULT VARCHAR, bulgarian_commander VARCHAR)\n\n Question: What are the name and results of the battles when... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ship (lost_in_battle VARCHAR, ship_type VARCHAR); CREATE TABLE battle (id VARCHAR, name VARCHAR)
Question: What are the different ids and names of the battles that lost a... | Your SQL query is correctly structured to retrieve the unique battle IDs and names associated with lost 'Brig' type ships. Here it is again wrapped in code formatting for clarity:
```
SELECT DISTINCT T1.id, T1.name
FROM battle AS T1
JOIN ship AS T2 ON T1.id = T2.lost_in_battle
WHERE T2.ship_type = 'Brig';
```
Thi... | 4,230 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ship (lost_in_battle VARCHAR, ship_type VARCHAR); CREATE TABLE battle (id VARCHAR, name VARCHAR)\n\n Question: What are the differ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE death (caused_by_ship_id VARCHAR, killed INTEGER); CREATE TABLE battle (id VARCHAR, name VARCHAR); CREATE TABLE ship (lost_in_battle VARCHAR, id VARCHAR)
Question: What a... | Here is the SQLite query to answer the question about the ids and names of the battles that led to more than 10 people killed in total:
```
SELECT T1.id, T1.name
FROM battle AS T1
JOIN ship AS T2 ON T1.id = T2.lost_in_battle
JOIN death AS T3 ON T2.id = T3.caused_by_ship_id
GROUP BY T1.id, T1.name
HAVING SUM(T3.ki... | 4,231 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE death (caused_by_ship_id VARCHAR, killed INTEGER); CREATE TABLE battle (id VARCHAR, name VARCHAR); CREATE TABLE ship (lost_in_battle ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE death (caused_by_ship_id VARCHAR); CREATE TABLE ship (Id VARCHAR)
Question: What is the ship id and name that caused most total injuries?
Here is the SQLite query to ans... | It looks like you want to find the ship ID and name that caused the most total injuries, but there are some issues with the query you provided. Specifically, the `ship` table does not have a `name` column according to the schema provided. Also, there are no fields regarding "injuries" mentioned in either table.
Assumi... | 4,232 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE death (caused_by_ship_id VARCHAR); CREATE TABLE ship (Id VARCHAR)\n\n Question: What is the ship id and name that caused most tota... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE battle (name VARCHAR, bulgarian_commander VARCHAR, latin_commander VARCHAR)
Question: What are the distinct battle names which are between bulgarian commander 'Kaloyan' a... | Your SQL query is almost correct, but to ensure that you get distinct battle names, you should use the `DISTINCT` keyword. Here’s the revised query wrapped in the proper code block as per your request:
```
SELECT DISTINCT name FROM battle WHERE bulgarian_commander = 'Kaloyan' AND latin_commander = 'Baldwin I';
``` | 4,233 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE battle (name VARCHAR, bulgarian_commander VARCHAR, latin_commander VARCHAR)\n\n Question: What are the distinct battle names which... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE battle (RESULT VARCHAR)
Question: How many different results are there for the battles?
Here is the SQLite query to answer to the question: How many different results ar... | Your SQLite query to count the different results for the battles is correct. Here it is, wrapped as you requested:
```
SELECT COUNT(DISTINCT RESULT) FROM battle;
``` | 4,234 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE battle (RESULT VARCHAR)\n\n Question: How many different results are there for the battles?\n\nHere is the SQLite query to answer ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ship (id VARCHAR, lost_in_battle VARCHAR, tonnage VARCHAR); CREATE TABLE battle (id VARCHAR, lost_in_battle VARCHAR, tonnage VARCHAR)
Question: How many battles did not l... | Your SQLite query is almost correct but needs a slight adjustment to ensure it filters battles properly. Here's the corrected query that answers the question:
```sql
SELECT COUNT(*)
FROM battle
WHERE id NOT IN (SELECT lost_in_battle FROM ship WHERE tonnage = '225');
```
This query counts the number of battles wher... | 4,235 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ship (id VARCHAR, lost_in_battle VARCHAR, tonnage VARCHAR); CREATE TABLE battle (id VARCHAR, lost_in_battle VARCHAR, tonnage VARCHAR)... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ship (lost_in_battle VARCHAR, name VARCHAR); CREATE TABLE battle (name VARCHAR, date VARCHAR, id VARCHAR)
Question: List the name and date the battle that has lost the sh... | Here is the SQLite query to list the name and date of the battle that has lost the ship named 'Lettice' and the ship named 'HMS Atalanta':
```
SELECT T1.name, T1.date
FROM battle AS T1
JOIN ship AS T2 ON T1.id = T2.lost_in_battle
WHERE T2.name = 'Lettice'
INTERSECT
SELECT T1.name, T1.date
FROM battle AS T1
JOIN ship A... | 4,236 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ship (lost_in_battle VARCHAR, name VARCHAR); CREATE TABLE battle (name VARCHAR, date VARCHAR, id VARCHAR)\n\n Question: List the n... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ship (lost_in_battle VARCHAR, location VARCHAR); CREATE TABLE battle (name VARCHAR, RESULT VARCHAR, bulgarian_commander VARCHAR); CREATE TABLE battle (name VARCHAR, result VAR... | Here is the SQLite query to answer the question:
```sql
SELECT name, RESULT, bulgarian_commander
FROM battle
WHERE name NOT IN (
SELECT T1.name
FROM battle AS T1
JOIN ship AS T2 ON T1.id = T2.lost_in_battle
WHERE T2.location = 'English Channel'
);
``` | 4,237 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ship (lost_in_battle VARCHAR, location VARCHAR); CREATE TABLE battle (name VARCHAR, RESULT VARCHAR, bulgarian_commander VARCHAR); CRE... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE death (note VARCHAR)
Question: What are the notes of the death events which has substring 'East'?
Here is the SQLite query to answer to the question: What are the notes ... | Your SQLite query is correct for retrieving the notes of the death events that contain the substring 'East'. Here it is wrapped as you requested:
```
SELECT note FROM death WHERE note LIKE '%East%'
``` | 4,238 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE death (note VARCHAR)\n\n Question: What are the notes of the death events which has substring 'East'?\n\nHere is the SQLite query ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE addresses (line_1 VARCHAR, line_2 VARCHAR)
Question: what are all the addresses including line 1 and line 2?
Here is the SQLite query to answer to the question: what are... | Here is the SQLite query to answer the question about what are all the addresses including line 1 and line 2:
```
SELECT line_1, line_2 FROM addresses;
``` | 4,239 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE addresses (line_1 VARCHAR, line_2 VARCHAR)\n\n Question: what are all the addresses including line 1 and line 2?\n\nHere is the SQ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Courses (Id VARCHAR)
Question: How many courses in total are listed?
Here is the SQLite query to answer to the question: How many courses in total are listed?:
```
SELEC... | Here is the SQLite query to answer the question of how many courses in total are listed:
```
SELECT COUNT(*) FROM Courses;
``` | 4,240 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Courses (Id VARCHAR)\n\n Question: How many courses in total are listed?\n\nHere is the SQLite query to answer to the question: Ho... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Courses (course_description VARCHAR, course_name VARCHAR)
Question: How is the math course described?
Here is the SQLite query to answer to the question: How is the math... | Here is the SQLite query to answer the question "How is the math course described?":
```
SELECT course_description FROM Courses WHERE course_name = 'math';
``` | 4,241 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Courses (course_description VARCHAR, course_name VARCHAR)\n\n Question: How is the math course described?\n\nHere is the SQLite qu... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Addresses (zip_postcode VARCHAR, city VARCHAR)
Question: What is the zip code of the address in the city Port Chelsea?
Here is the SQLite query to answer to the question... | Here is the SQLite query to answer the question about the zip code of the address in the city Port Chelsea:
```
SELECT zip_postcode FROM Addresses WHERE city = 'Port Chelsea';
``` | 4,242 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Addresses (zip_postcode VARCHAR, city VARCHAR)\n\n Question: What is the zip code of the address in the city Port Chelsea?\n\nHere... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Degree_Programs (department_id VARCHAR); CREATE TABLE Departments (department_name VARCHAR, department_id VARCHAR)
Question: Which department offers the most number of de... | Your SQLite query to determine which department offers the most number of degrees is correct. It joins the `Degree_Programs` table with the `Departments` table on `department_id`, groups the results by `department_id`, counts the number of degrees offered per department, and then orders the results in descending order ... | 4,243 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Degree_Programs (department_id VARCHAR); CREATE TABLE Departments (department_name VARCHAR, department_id VARCHAR)\n\n Question: W... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE degree_programs (department_id VARCHAR); CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR)
Question: What is the name and id of the department wit... | Your provided SQLite query looks correct and effectively answers the question regarding which department has the most number of degrees. Here it is wrapped as requested:
```sql
SELECT t2.department_name, t1.department_id
FROM degree_programs AS t1
JOIN departments AS t2 ON t1.department_id = t2.department_id
GROUP BY ... | 4,244 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE degree_programs (department_id VARCHAR); CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR)\n\n Question: W... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Degree_Programs (department_id VARCHAR)
Question: How many departments offer any degree?
Here is the SQLite query to answer to the question: How many departments offer a... | Here is the SQLite query to answer the question about how many departments offer any degree:
```
SELECT COUNT(DISTINCT department_id) FROM Degree_Programs;
``` | 4,245 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Degree_Programs (department_id VARCHAR)\n\n Question: How many departments offer any degree?\n\nHere is the SQLite query to answer... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Degree_Programs (degree_summary_name VARCHAR)
Question: How many different degree names are offered?
Here is the SQLite query to answer to the question: How many differe... | Your query to count the number of different degree names offered in the `Degree_Programs` table is correct. Here it is wrapped in the appropriate code block:
```
SELECT COUNT(DISTINCT degree_summary_name) FROM Degree_Programs;
``` | 4,246 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Degree_Programs (degree_summary_name VARCHAR)\n\n Question: How many different degree names are offered?\n\nHere is the SQLite que... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Degree_Programs (department_id VARCHAR); CREATE TABLE Departments (department_id VARCHAR, department_name VARCHAR)
Question: How many degrees does the engineering departm... | The SQLite query you provided contains a small issue with the department name used in the WHERE clause. It should match the full name "engineering" instead of "engineer". Here’s the corrected query:
```sql
SELECT COUNT(*)
FROM Departments AS T1
JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id
WHERE... | 4,247 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Degree_Programs (department_id VARCHAR); CREATE TABLE Departments (department_id VARCHAR, department_name VARCHAR)\n\n Question: H... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Sections (section_name VARCHAR, section_description VARCHAR)
Question: What are the names and descriptions of all the sections?
Here is the SQLite query to answer to the... | Here is the SQLite query to answer the question about the names and descriptions of all the sections:
```
SELECT section_name, section_description FROM Sections
``` | 4,248 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Sections (section_name VARCHAR, section_description VARCHAR)\n\n Question: What are the names and descriptions of all the sections... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Sections (course_id VARCHAR)
Question: What are the names and id of courses having at most 2 sections?
Her... | Your query looks correct for the requirement to find the names and IDs of courses having at most 2 sections. Here's the query wrapped in code formatting:
```
SELECT T1.course_name, T1.course_id
FROM Courses AS T1
JOIN Sections AS T2 ON T1.course_id = T2.course_id
GROUP BY T1.course_id
HAVING COUNT(*) <= 2
```
Thi... | 4,249 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Sections (course_id VARCHAR)\n\n Question: What are the names and i... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Sections (section_name VARCHAR)
Question: List the section_name in reversed lexicographical order.
Here is the SQLite query to answer to the question: List the section_n... | Here is the SQLite query to list the `section_name` in reversed lexicographical order:
```sql
SELECT section_name FROM Sections ORDER BY section_name DESC;
``` | 4,250 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Sections (section_name VARCHAR)\n\n Question: List the section_name in reversed lexicographical order.\n\nHere is the SQLite query... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Student_Enrolment (semester_id VARCHAR); CREATE TABLE Semesters (semester_name VARCHAR, semester_id VARCHAR)
Question: What is the semester which most student registered ... | Your SQLite query is correctly structured to find the semester with the most student registrations. Here it is wrapped in code format:
```
SELECT T1.semester_name, T1.semester_id
FROM Semesters AS T1
JOIN Student_Enrolment AS T2 ON T1.semester_id = T2.semester_id
GROUP BY T1.semester_id
ORDER BY COUNT(*) DESC
LIM... | 4,251 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Student_Enrolment (semester_id VARCHAR); CREATE TABLE Semesters (semester_name VARCHAR, semester_id VARCHAR)\n\n Question: What is... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Departments (department_description VARCHAR, department_name VARCHAR)
Question: What is the description of the department whose name has the substring the computer?
Here... | Here is the SQLite query to answer the question regarding the description of the department whose name has the substring "computer":
```
SELECT department_description FROM Departments WHERE department_name LIKE '%computer%'
``` | 4,252 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Departments (department_description VARCHAR, department_name VARCHAR)\n\n Question: What is the description of the department whos... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, student_id VARCHAR); CREATE TABLE Student_Enrolment (student_id VARCHAR)
Question: Who are enrolled ... | The provided SQLite query needs a slight adjustment since the `Student_Enrolment` table should contain more information about degree programs. Assuming that each enrollment corresponds to a specific degree program for simplicity, the query should work correctly just based on student IDs in the `Student_Enrolment` table... | 4,253 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, student_id VARCHAR); CREATE TABLE Student_Enrolment (student_id... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Degree_Programs (degree_program_id VARCHAR, degree_summary_name VARCHAR); CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, student_id VARCHAR... | Certainly! Below is the SQLite query that retrieves the first name, middle name, and last name of students enrolled in a Bachelor degree program:
```
SELECT DISTINCT T1.first_name, T1.middle_name, T1.last_name
FROM Students AS T1
JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id
JOIN Degree_Programs AS ... | 4,254 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Degree_Programs (degree_program_id VARCHAR, degree_summary_name VARCHAR); CREATE TABLE Students (first_name VARCHAR, middle_name VARC... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Student_Enrolment (degree_program_id VARCHAR); CREATE TABLE Degree_Programs (degree_summary_name VARCHAR, degree_program_id VARCHAR)
Question: Find the kind of program wh... | Your SQLite query is correct for finding the program with the most students enrolled. Here is your query wrapped appropriately:
```
SELECT T1.degree_summary_name
FROM Degree_Programs AS T1
JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id
GROUP BY T1.degree_summary_name
ORDER BY COUNT(*) ... | 4,255 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Student_Enrolment (degree_program_id VARCHAR); CREATE TABLE Degree_Programs (degree_summary_name VARCHAR, degree_program_id VARCHAR)\... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Degree_Programs (degree_program_id VARCHAR, degree_summary_name VARCHAR); CREATE TABLE Student_Enrolment (degree_program_id VARCHAR)
Question: Find the program which most... | Here is the SQLite query to find the program with the most number of students enrolled, including both the program ID and the summary:
```
SELECT T1.degree_program_id, T1.degree_summary_name
FROM Degree_Programs AS T1
JOIN Student_Enrolment AS T2
ON T1.degree_program_id = T2.degree_program_id
GROUP BY T1.degree_pr... | 4,256 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Degree_Programs (degree_program_id VARCHAR, degree_summary_name VARCHAR); CREATE TABLE Student_Enrolment (degree_program_id VARCHAR)\... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Students (student_id VARCHAR, first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR); CREATE TABLE Student_Enrolment (student_id VARCHAR)
Question: Which student has... | Here is the SQLite query to answer the question about which student has enrolled for the most times, along with the required details:
```
SELECT T1.student_id, T1.first_name, T1.middle_name, T1.last_name, COUNT(T2.student_id) AS enrollment_count
FROM Students AS T1
JOIN Student_Enrolment AS T2 ON T1.student_id = T2.st... | 4,257 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Students (student_id VARCHAR, first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR); CREATE TABLE Student_Enrolment (student_id... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Student_Enrolment (semester_name VARCHAR, semester_id VARCHAR); CREATE TABLE Semesters (semester_name VARCHAR, semester_id VARCHAR)
Question: Which semesters do not have ... | Your SQLite query to find semesters without any student enrolled is correct. Here it is wrapped in code format:
```
SELECT semester_name
FROM Semesters
WHERE semester_id NOT IN (SELECT semester_id FROM Student_Enrolment);
```
This query selects the names of semesters from the `Semesters` table where the `semester_i... | 4,258 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Student_Enrolment (semester_name VARCHAR, semester_id VARCHAR); CREATE TABLE Semesters (semester_name VARCHAR, semester_id VARCHAR)\n... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Enrolment_Courses (course_id VARCHAR)
Question: What are all the course names of the courses which ... | Your SQLite query is correct. It retrieves all distinct course names from the `Courses` table for the courses that have students enrolled in them by joining the `Courses` table with the `Student_Enrolment_Courses` table on the `course_id`.
Here is the query wrapped in code format:
```
SELECT DISTINCT T1.course_name ... | 4,259 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Enrolment_Courses (course_id VARCHAR)\n\n Question: What ar... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Enrolment_Courses (course_id VARCHAR)
Question: What's the name of the course with most number of e... | Your provided SQL query is correctly structured to answer the question about the course with the most enrollments. It joins the `Courses` table with the `Student_Enrolment_Courses` table using the `course_id`, groups the results by `course_name`, counts the enrollments for each course, and orders them in descending ord... | 4,260 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Enrolment_Courses (course_id VARCHAR)\n\n Question: What's ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Addresses (address_id VARCHAR, state_province_county VARCHAR); CREATE TABLE Students (last_name VARCHAR, current_address_id VARCHAR); CREATE TABLE Students (last_name VARCHAR,... | Your question contains a small error in the table definitions and how the query is written. The `Students` table is defined twice, which would result in an SQL error.
Here’s a corrected version of the schema and SQL query to find the last names of students who currently live in North Carolina but have not registered ... | 4,261 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Addresses (address_id VARCHAR, state_province_county VARCHAR); CREATE TABLE Students (last_name VARCHAR, current_address_id VARCHAR);... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Transcript_Contents (transcript_id VARCHAR); CREATE TABLE Transcripts (transcript_date VARCHAR, transcript_id VARCHAR)
Question: Show the date and id of the transcript wi... | Your provided SQLite query looks correct for the requirements to retrieve the date and ID of transcripts that have at least 2 associated course results. Here is the query wrapped properly:
```
SELECT T2.transcript_date, T1.transcript_id
FROM Transcript_Contents AS T1
JOIN Transcripts AS T2 ON T1.transcript_id = T2.t... | 4,262 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Transcript_Contents (transcript_id VARCHAR); CREATE TABLE Transcripts (transcript_date VARCHAR, transcript_id VARCHAR)\n\n Questio... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Students (cell_mobile_number VARCHAR, first_name VARCHAR, last_name VARCHAR)
Question: What is the phone number of the man with the first name Timmothy and the last name ... | Here is the SQLite query to answer the question about the phone number of the man with the first name Timmothy and the last name Ward:
```
SELECT cell_mobile_number FROM Students WHERE first_name = 'Timmothy' AND last_name = 'Ward'
``` | 4,263 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Students (cell_mobile_number VARCHAR, first_name VARCHAR, last_name VARCHAR)\n\n Question: What is the phone number of the man wit... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE students (cell_mobile_number VARCHAR, first_name VARCHAR, last_name VARCHAR)
Question: What is the mobile phone number of the student named Timmothy Ward ?
Here is the S... | Here is the SQLite query to find the mobile phone number of the student named Timmothy Ward:
```
SELECT cell_mobile_number FROM students WHERE first_name = 'Timmothy' AND last_name = 'Ward';
``` | 4,264 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE students (cell_mobile_number VARCHAR, first_name VARCHAR, last_name VARCHAR)\n\n Question: What is the mobile phone number of the ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, date_first_registered VARCHAR)
Question: Who is the first student to register? List the first name, ... | Here is the SQLite query to answer the question about who the first student to register is, including their first name, middle name, and last name:
```
SELECT first_name, middle_name, last_name FROM Students ORDER BY date_first_registered LIMIT 1
``` | 4,265 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, date_first_registered VARCHAR)\n\n Question: Who is the firs... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, date_left VARCHAR)
Question: Who is the earliest graduate of the school? List the first name, middle... | Your SQLite query is correct for retrieving the earliest graduate based on the `date_left` field. Here’s the query wrapped in the appropriate format:
```
SELECT first_name, middle_name, last_name FROM Students ORDER BY date_left LIMIT 1;
``` | 4,266 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, date_left VARCHAR)\n\n Question: Who is the earliest graduat... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Students (first_name VARCHAR, current_address_id VARCHAR, permanent_address_id VARCHAR)
Question: Whose permanent address is different from his or her current address? Li... | Your SQLite query to find the first names of students whose permanent address is different from their current address is correct. Here it is wrapped in code formatting:
```
SELECT first_name FROM Students WHERE current_address_id <> permanent_address_id;
```
This query retrieves the `first_name` of students where th... | 4,267 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Students (first_name VARCHAR, current_address_id VARCHAR, permanent_address_id VARCHAR)\n\n Question: Whose permanent address is d... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Addresses (address_id VARCHAR, line_1 VARCHAR, line_2 VARCHAR); CREATE TABLE Students (current_address_id VARCHAR)
Question: Which address holds the most number of studen... | Here is the SQLite query to answer the question regarding which address holds the most number of students currently, along with the address ID and all lines:
```sql
SELECT T1.address_id, T1.line_1, T1.line_2
FROM Addresses AS T1
JOIN Students AS T2 ON T1.address_id = T2.current_address_id
GROUP BY T1.address_id, T1... | 4,268 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Addresses (address_id VARCHAR, line_1 VARCHAR, line_2 VARCHAR); CREATE TABLE Students (current_address_id VARCHAR)\n\n Question: W... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Transcripts (transcript_date INTEGER)
Question: On average, when were the transcripts printed?
Here is the SQLite query to answer to the question: On average, when were ... | Your query for calculating the average date when the transcripts were printed is correct. Here's the SQLite code wrapped properly:
```
SELECT AVG(transcript_date) FROM Transcripts;
```
This query will return the average of the `transcript_date` values from the `Transcripts` table, which gives you the average date wh... | 4,269 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Transcripts (transcript_date INTEGER)\n\n Question: On average, when were the transcripts printed?\n\nHere is the SQLite query to ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Transcripts (transcript_date VARCHAR, other_details VARCHAR)
Question: When is the first transcript released? List the date and details.
Here is the SQLite query to answ... | Your SQLite query is correct for retrieving the earliest transcript date along with its details. Here it is wrapped as requested:
```
SELECT transcript_date, other_details FROM Transcripts ORDER BY transcript_date LIMIT 1;
``` | 4,270 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Transcripts (transcript_date VARCHAR, other_details VARCHAR)\n\n Question: When is the first transcript released? List the date an... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Transcripts (Id VARCHAR)
Question: How many transcripts are released?
Here is the SQLite query to answer to the question: How many transcripts are released?:
```
SELECT ... | Your SQLite query to count the number of transcripts released is correct. Here it is formatted as you requested:
```
SELECT COUNT(*) FROM Transcripts;
``` | 4,271 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Transcripts (Id VARCHAR)\n\n Question: How many transcripts are released?\n\nHere is the SQLite query to answer to the question: H... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Transcripts (transcript_date VARCHAR)
Question: What is the last transcript release date?
Here is the SQLite query to answer to the question: What is the last transcript... | Your SQLite query is correct for retrieving the last transcript release date. Here's the query wrapped in the appropriate code format:
```
SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1
```
This query orders the `transcript_date` in descending order, ensuring that the most recent date ... | 4,272 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Transcripts (transcript_date VARCHAR)\n\n Question: What is the last transcript release date?\n\nHere is the SQLite query to answe... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Transcript_Contents (student_course_id VARCHAR)
Question: How many times at most can a course enrollment result show in different transcripts? Also show the course enroll... | Your SQLite query is correct in that it counts the occurrences of each `student_course_id` in the `Transcript_Contents` table, groups the results by `student_course_id`, orders them in descending order by their count, and limits the output to the top result. However, to clearly identify the course enrollment id that ha... | 4,273 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Transcript_Contents (student_course_id VARCHAR)\n\n Question: How many times at most can a course enrollment result show in differ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Transcript_Contents (transcript_id VARCHAR); CREATE TABLE Transcripts (transcript_date VARCHAR, transcript_id VARCHAR)
Question: Show the date of the transcript which sho... | Your provided query is almost correct, but it needs a slight modification to adhere to best practices in SQL, particularly in how the `GROUP BY` and the `ORDER BY` clauses are used.
Here’s the refined SQLite query to show the date of the transcript which shows the least number of results, along with the transcript id:... | 4,274 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Transcript_Contents (transcript_id VARCHAR); CREATE TABLE Transcripts (transcript_date VARCHAR, transcript_id VARCHAR)\n\n Questio... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Degree_Programs (degree_program_id VARCHAR); CREATE TABLE Student_Enrolment (semester_id VARCHAR, degree_program_id VARCHAR)
Question: Find the semester when both Master ... | It looks like there are some discrepancies in the provided schema and the query. In the schema, there is no `degree_summary_name` field in the `Degree_Programs` table. To accurately answer the question, I’m assuming that the `Degree_Programs` table actually has a field that specifies the type of degree, such as a `degr... | 4,275 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Degree_Programs (degree_program_id VARCHAR); CREATE TABLE Student_Enrolment (semester_id VARCHAR, degree_program_id VARCHAR)\n\n Q... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Students (current_address_id VARCHAR)
Question: How many different addresses do the students currently live?
Here is the SQLite query to answer to the question: How many... | Your SQLite query is correct. It will count the number of distinct addresses from the `current_address_id` column in the `Students` table. Here’s the query wrapped in code tags as requested:
```
SELECT COUNT(DISTINCT current_address_id) FROM Students;
``` | 4,276 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Students (current_address_id VARCHAR)\n\n Question: How many different addresses do the students currently live?\n\nHere is the SQ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Students (other_student_details VARCHAR)
Question: List all the student details in reversed lexicographical order.
Here is the SQLite query to answer to the question: Li... | Here is the SQLite query to list all the student details in reversed lexicographical order:
```
SELECT other_student_details FROM Students ORDER BY other_student_details DESC
``` | 4,277 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Students (other_student_details VARCHAR)\n\n Question: List all the student details in reversed lexicographical order.\n\nHere is ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Sections (section_description VARCHAR, section_name VARCHAR)
Question: Describe the section h.
Here is the SQLite query to answer to the question: Describe the section h... | Here is the SQLite query to describe the section 'h':
```
SELECT section_description FROM Sections WHERE section_name = 'h'
``` | 4,278 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Sections (section_description VARCHAR, section_name VARCHAR)\n\n Question: Describe the section h.\n\nHere is the SQLite query to ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE students (first_name VARCHAR, permanent_address_id VARCHAR, cell_mobile_number VARCHAR); CREATE TABLE addresses (address_id VARCHAR, country VARCHAR)
Question: Find the f... | Here is the SQLite query that answers the question:
```
SELECT t1.first_name
FROM students AS t1
JOIN addresses AS t2 ON t1.permanent_address_id = t2.address_id
WHERE t2.country = 'Haiti' OR t1.cell_mobile_number = '09700166582';
``` | 4,279 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE students (first_name VARCHAR, permanent_address_id VARCHAR, cell_mobile_number VARCHAR); CREATE TABLE addresses (address_id VARCHAR, ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Cartoon (Title VARCHAR, title VARCHAR)
Question: List the title of all cartoons in alphabetical order.
Here is the SQLite query to answer to the question: List the title... | It looks like there is a slight issue in your provided query. The column names are case-sensitive and should match exactly as defined in the schema. Given the schema `CREATE TABLE Cartoon (Title VARCHAR, title VARCHAR)`, the correct column to select is "Title" (uppercase 'T').
Here is the corrected SQLite query wrapp... | 4,280 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Cartoon (Title VARCHAR, title VARCHAR)\n\n Question: List the title of all cartoons in alphabetical order.\n\nHere is the SQLite q... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Cartoon (Title VARCHAR, Directed_by VARCHAR)
Question: List all cartoon directed by "Ben Jones".
Here is the SQLite query to answer to the question: List all cartoon dir... | Your SQLite query is correct. Here it is wrapped in the requested format:
```
SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones";
``` | 4,281 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Cartoon (Title VARCHAR, Directed_by VARCHAR)\n\n Question: List all cartoon directed by \"Ben Jones\".\n\nHere is the SQLite query... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Cartoon (Written_by VARCHAR)
Question: How many cartoons were written by "Joseph Kuhr"?
Here is the SQLite query to answer to the question: How many cartoons were writte... | Here is the SQLite query to answer the question of how many cartoons were written by "Joseph Kuhr":
```
SELECT COUNT(*) FROM Cartoon WHERE Written_by = "Joseph Kuhr";
``` | 4,282 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Cartoon (Written_by VARCHAR)\n\n Question: How many cartoons were written by \"Joseph Kuhr\"?\n\nHere is the SQLite query to answe... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Cartoon (title VARCHAR, Directed_by VARCHAR, Original_air_date VARCHAR)
Question: list all cartoon titles and their directors ordered by their air date
Here is the SQLit... | Here is the SQLite query to answer the question, which lists all cartoon titles and their directors ordered by their air date:
```
SELECT title, Directed_by FROM Cartoon ORDER BY Original_air_date;
``` | 4,283 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Cartoon (title VARCHAR, Directed_by VARCHAR, Original_air_date VARCHAR)\n\n Question: list all cartoon titles and their directors ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Cartoon (Title VARCHAR, Directed_by VARCHAR)
Question: List the title of all cartoon directed by "Ben Jones" or "Brandon Vietti".
Here is the SQLite query to answer to t... | Here is the SQLite query to answer the question:
```
SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones" OR Directed_by = "Brandon Vietti"
``` | 4,284 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Cartoon (Title VARCHAR, Directed_by VARCHAR)\n\n Question: List the title of all cartoon directed by \"Ben Jones\" or \"Brandon Vi... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_Channel (Country VARCHAR)
Question: Which country has the most of TV Channels? List the country and number of TV Channels it has.
Here is the SQLite query to answer t... | Your provided query is correct. Here’s the SQLite query to answer the question of which country has the most TV channels and to list that country along with the number of TV channels it has:
```
SELECT Country, COUNT(*) AS NumberOfChannels
FROM TV_Channel
GROUP BY Country
ORDER BY NumberOfChannels DESC
LIMIT 1;
``... | 4,285 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_Channel (Country VARCHAR)\n\n Question: Which country has the most of TV Channels? List the country and number of TV Channels i... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_Channel (series_name VARCHAR, content VARCHAR)
Question: List the number of different series names and contents in the TV Channel table.
Here is the SQLite query to a... | Your PostgreSQL query looks correct for counting the distinct series names and contents in the `TV_Channel` table. Here it is wrapped in the requested code format:
```
SELECT COUNT(DISTINCT series_name), COUNT(DISTINCT content) FROM TV_Channel;
``` | 4,286 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_Channel (series_name VARCHAR, content VARCHAR)\n\n Question: List the number of different series names and contents in the TV C... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_Channel (Content VARCHAR, series_name VARCHAR)
Question: What is the content of TV Channel with serial name "Sky Radio"?
Here is the SQLite query to answer to the que... | Here is the SQLite query to answer the question: What is the content of TV Channel with serial name "Sky Radio"?:
```
SELECT Content FROM TV_Channel WHERE series_name = "Sky Radio";
``` | 4,287 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_Channel (Content VARCHAR, series_name VARCHAR)\n\n Question: What is the content of TV Channel with serial name \"Sky Radio\"?\... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_Channel (Package_Option VARCHAR, series_name VARCHAR)
Question: What is the Package Option of TV Channel with serial name "Sky Radio"?
Here is the SQLite query to ans... | Here is the SQLite query to answer the question regarding the Package Option of the TV Channel with the serial name "Sky Radio":
```
SELECT Package_Option FROM TV_Channel WHERE series_name = "Sky Radio";
``` | 4,288 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_Channel (Package_Option VARCHAR, series_name VARCHAR)\n\n Question: What is the Package Option of TV Channel with serial name \... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_Channel (LANGUAGE VARCHAR)
Question: How many TV Channel using language English?
Here is the SQLite query to answer to the question: How many TV Channel using languag... | Here is the SQLite query to answer the question of how many TV channels are using the language English:
```
SELECT COUNT(*) FROM TV_Channel WHERE LANGUAGE = "English";
``` | 4,289 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_Channel (LANGUAGE VARCHAR)\n\n Question: How many TV Channel using language English?\n\nHere is the SQLite query to answer to t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_Channel (LANGUAGE VARCHAR)
Question: List the language used least number of TV Channel. List language and number of TV Channel.
Here is the SQLite query to answer to ... | Your query is almost correct, but it will return only one of the languages with the least number of TV channels if there are ties. To ensure that you get all the languages that share the least number of channels, you should first calculate the minimum count and then filter for it.
Here is the adjusted query:
```sql
S... | 4,290 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_Channel (LANGUAGE VARCHAR)\n\n Question: List the language used least number of TV Channel. List language and number of TV Chan... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_Channel (LANGUAGE VARCHAR)
Question: List each language and the number of TV Channels using it.
Here is the SQLite query to answer to the question: List each language... | Here is the SQLite query to list each language and the number of TV channels using it:
```
SELECT LANGUAGE, COUNT(*) AS Channel_Count FROM TV_Channel GROUP BY LANGUAGE
``` | 4,291 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_Channel (LANGUAGE VARCHAR)\n\n Question: List each language and the number of TV Channels using it.\n\nHere is the SQLite query... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Cartoon (Channel VARCHAR, Title VARCHAR); CREATE TABLE TV_Channel (series_name VARCHAR, id VARCHAR)
Question: What is the TV Channel that shows the cartoon "The Rise of t... | Here is the SQLite query to answer the question regarding the TV Channel that shows the cartoon "The Rise of the Blue Beetle!" and to list the TV Channel's series name:
```
SELECT T1.series_name
FROM TV_Channel AS T1
JOIN Cartoon AS T2 ON T1.id = T2.Channel
WHERE T2.Title = "The Rise of the Blue Beetle!";
``` | 4,292 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Cartoon (Channel VARCHAR, Title VARCHAR); CREATE TABLE TV_Channel (series_name VARCHAR, id VARCHAR)\n\n Question: What is the TV C... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Cartoon (Title VARCHAR, Channel VARCHAR); CREATE TABLE TV_Channel (id VARCHAR, series_name VARCHAR)
Question: List the title of all Cartoons showed on TV Channel with se... | Your SQLite query to list the titles of all Cartoons shown on the TV Channel with the series name "Sky Radio" is correct. Here's the formatted code:
```
SELECT T2.Title
FROM TV_Channel AS T1
JOIN Cartoon AS T2 ON T1.id = T2.Channel
WHERE T1.series_name = "Sky Radio"
```
This query correctly joins the `TV_Channel`... | 4,293 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Cartoon (Title VARCHAR, Channel VARCHAR); CREATE TABLE TV_Channel (id VARCHAR, series_name VARCHAR)\n\n Question: List the title o... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_series (Episode VARCHAR, rating VARCHAR)
Question: List the Episode of all TV series sorted by rating.
Here is the SQLite query to answer to the question: List the Ep... | Here is the SQLite query to list the Episode of all TV series sorted by rating:
```
SELECT Episode FROM TV_series ORDER BY rating;
``` | 4,294 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_series (Episode VARCHAR, rating VARCHAR)\n\n Question: List the Episode of all TV series sorted by rating.\n\nHere is the SQLit... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_series (Episode VARCHAR, Rating VARCHAR)
Question: List top 3 highest Rating TV series. List the TV series's Episode and Rating.
Here is the SQLite query to answer t... | Your query looks good for listing the top 3 highest rated TV series based on the given schema. However, if the `Rating` column contains non-numeric values (for example, stars instead of numbers), you may need to convert the ratings into a comparable format. If the `Rating` is already in a clear numeric format, your que... | 4,295 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_series (Episode VARCHAR, Rating VARCHAR)\n\n Question: List top 3 highest Rating TV series. List the TV series's Episode and R... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_series (SHARE INTEGER)
Question: What is minimum and maximum share of TV series?
Here is the SQLite query to answer to the question: What is minimum and maximum share... | ```
SELECT MAX(SHARE), MIN(SHARE) FROM TV_series
``` | 4,296 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_series (SHARE INTEGER)\n\n Question: What is minimum and maximum share of TV series?\n\nHere is the SQLite query to answer to t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_series (Air_Date VARCHAR, Episode VARCHAR)
Question: What is the air date of TV series with Episode "A Love of a Lifetime"?
Here is the SQLite query to answer to the ... | Here is the SQLite query to answer the question about the air date of the TV series with the episode "A Love of a Lifetime":
```
SELECT Air_Date FROM TV_series WHERE Episode = "A Love of a Lifetime";
``` | 4,297 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_series (Air_Date VARCHAR, Episode VARCHAR)\n\n Question: What is the air date of TV series with Episode \"A Love of a Lifetime\... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_series (Weekly_Rank VARCHAR, Episode VARCHAR)
Question: What is Weekly Rank of TV series with Episode "A Love of a Lifetime"?
Here is the SQLite query to answer to th... | Your SQLite query is correct. Here is the query wrapped in code formatting:
```
SELECT Weekly_Rank FROM TV_series WHERE Episode = "A Love of a Lifetime";
``` | 4,298 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_series (Weekly_Rank VARCHAR, Episode VARCHAR)\n\n Question: What is Weekly Rank of TV series with Episode \"A Love of a Lifetim... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE TV_series (Channel VARCHAR, Episode VARCHAR); CREATE TABLE TV_Channel (series_name VARCHAR, id VARCHAR)
Question: What is the TV Channel of TV series with Episode "A Love... | Here is the SQLite query to answer the question: What is the TV Channel of TV series with Episode "A Love of a Lifetime"? List the TV Channel's series name.
```
SELECT T1.series_name
FROM TV_Channel AS T1
JOIN TV_series AS T2 ON T1.id = T2.Channel
WHERE T2.Episode = "A Love of a Lifetime"
``` | 4,299 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE TV_series (Channel VARCHAR, Episode VARCHAR); CREATE TABLE TV_Channel (series_name VARCHAR, id VARCHAR)\n\n Question: What is the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.